PHP Array Correlation Function Summary
This article mainly introduces the PHP array related functions, summarizes the related arrays in PHP, has a certain reference value, the need for friends can refer to the following
This article summarizes the functions associated with PHP arrays. Share to everyone for your reference. Specific as follows:
This includes the function name and usage instructions, with no detailed code examples. Interested friends can consult the relevant functions of the site usage.
Related processing functions for arrays
Current (array name) outputs the value of a string in the array, starting with the first one.
Key (array name) an subscript from the output array, starting from the first one.
Next (array name) controls the array pointer to move backwards.
Prev (array name) controls the array pointer to move forward.
End (array name) controls the array pointer moves to the last one.
Reset (array name) controls the array pointer to the first bit.
Array_change_key_case (1. Target array 2.case_upper uppercase or Case_lower lowercase) changes the array subscript all to uppercase or lowercase.
Array_chunk (1. Target array 2. Number of decomposition 3. Output Boolean true or false) breaks an array into multiple decimal groups.
The Array_count_values (array name) is used to calculate the number of occurrences of each value in the array.
Array_fill (1. Subscript starting from several 2. How many 3. What are their values) used to initialize the array.
Array_filter (1. Target array 2. The user-defined function) filters the function, customizing what criteria to be true, and by what criteria is false, this function can automatically filter out false strings.
Array_flip (target array) the subscript variable value, the value of the subscript.
Array_sum (destination array) calculates the sum of all the element values in the destination array.
Array_unique (target array) removes duplicate values from the target array.
Array_values (target array) removes all subscripts from the target array, starting with "0" to calculate the subscript of the value in this function.
Array_keys (destination array) outputs all subscripts in the destination array.
In_array (1. What to look for 2. Target array 3. Whether to search strictly by data type, is to lose true) look for data in the target array that has no lookup.
Array_search (1. What to look for 2. Target array 3. Whether or not to find the target array with no lookup data, and then output the subscript for this data.
Array_key_exists (1. Subscript 2. Target array) Find the subscript in the target array with no lookup, then output true, and false for none.
Extract (target array) converts an array into a variable.
Compact (the variable subscript to convert an array) converts multiple variables into an array.
Arrays and stacks (advanced back-out)
Array_push (1. Target array 2. The value of the push-in stack) is pressed into the stack function.
Array_pop (target array) popup stack function.
Array and Team (FIFO)
Array_unshift (1. Target array 2. The value of the press-in pair) presses into the pair function.
Array_shift (1 target array) pops up on the function.
Array ordering for ignoring key names:
Sort (target array) from small to large.
Rsort (target array) from the large to the small sort.
Sort an array of reserved key names:
Asort (target array) retains the original subscript, and the values are sorted from small to large.
Arsort (target array) retains the original subscript, and the values are sorted from large to small.
Sort by natural sort:
The Natsort (target array) retains the original subscript, with a value from a large to a small sort, not case sensitive.
The Natcasesort (target array) retains the original subscript, and the values are sorted from small to large, not case-sensitive.
Array_merge (1. Target array 2. Target array ...) merges multiple arrays.
Array_diff (1. Be compared to array 2. than array 3. than array ...) to find the difference of the array.
Array_intersect (1. is compared to array 2. than array 3. than array ...) to find the cross-product of the array.
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/973116.html www.bkjia.com true http://www.bkjia.com/PHPjc/973116.html techarticle PHP Array Correlation function Summary This article mainly introduces the PHP array correlation function, summarizes the PHP related array, has certain reference value, needs the friend can refer to this article ...