1, locate the array:
- BOOL In_array (mixed needle,array Haystack[,bool Strict]) finds the specified element;
- Array array_keys (arraqy input [, mixed search_value]) returns an array of key values;
- BOOL array_key_exists(mixed key,array search) determines whether the key value is the specified key value;
- Array array_values (array input) returns the value of the element in the array;
- 2, iterate through the array:
- Mixed key (array input) returns the key value of the current pointer element;
- Mixed reset ( array input_array) Resets the pointer to the starting position of the array;
- Array Each (array Input_array) returns the array value of the current pointer position;
- Mixed current (array input_array) Returns the value of the array element at the position of the currently pointer;
- Mixed End ( array input_array) Returns the current pointer pointing to the last element;
- Mixed next (array Input_array) returns the array element at the next position of the current pointer;
- Mixed prev (array Input_array) returns the array value at the previous position of the current pointer;
- 3, adding, deleting array elements:
- int array_push( array & array, Mixe var [, mixed ...]) Increments the specified value to the end of the array;
- Mixed array_pop (array & array) returns the last element of the array and resets the array pointer;
- Mixed array_shift(array Target_array) returns the first element value of the array;
- int array_unshift ( array &array, mixed var [, mixed ...]) Adds the specified element to the starting position
- Array array_pad(array input,int pad_size,mixed pad_value) increments the array to the specified length
- 4, sort the array:
- BOOL Sort/rsort (array &array[, int sort_flags]); ascending and descending;
- 5, merging and splitting of arrays:
- Array The merging of Array_combine( array keys, arrays values);
- Array array_merge(array array1[,array array2[ Array array...]) Multiple arrays are merged and a new array is returned;
- Array array_slice ( array array, int offset[,int Length]) extracts the specified length from the specified position of the array and saves it to a new array;
- Array Explode(string separator,string string) is split before the result is saved;
- Array implode (string glue,array pieces) specifies the new character in which the element is concatenated via a string;
- 5, create an array of the specified range:
- Array Range (Mixe Low, mixed high[,number step]) creates an array of the specified range;
- Array Shuffle ($array) randomly sorts the elements in the specified array;
- Number array_sum (array Input_array) sums all the elements;
The above describes the common array functions in PHP, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.