Array functions with syntax
1.in_array(search,array,type)
The in_array() function searches an array for a specific value, This function returns TRUE if the value is found in the array, or FALSE otherwise
2.count(),sizeof() both are same
3.list(var1,var2...)
The list() function is used to assign values to a list of variables in one operation, This function only works on numerical arrays
4.array_sum()
Returns the sum of the values in an array
5.array_unique(array1)
Removes duplicate values from an array
6.array_combine(array1,array2)
The array_combine() function creates an array by combining two other arrays, where the first array is the keys, and the other array is the values.
6.sort()-Sorts an array
7.rsort()-Sorts an array in reverse order
1.in_array(search,array,type)
The in_array() function searches an array for a specific value, This function returns TRUE if the value is found in the array, or FALSE otherwise
2.count(),sizeof() both are same
3.list(var1,var2...)
The list() function is used to assign values to a list of variables in one operation, This function only works on numerical arrays
4.array_sum()
Returns the sum of the values in an array
5.array_unique(array1)
Removes duplicate values from an array
6.array_combine(array1,array2)
The array_combine() function creates an array by combining two other arrays, where the first array is the keys, and the other array is the values.
6.sort()-Sorts an array
7.rsort()-Sorts an array in reverse order
No comments:
Post a Comment