Notes on PHP array functions

Source: Internet
Author: User
PHP array function note array_change_key_case -- returns an array of array_chunk whose string keys are all lowercase or uppercase -- splits an array into multiple array_combine -- creates an array, use the value of one array as its key name, and the value of another array as its value array_count_values -- count the number of times all values in the array appear in array_di PHP array function notes

Array_change_key_case -- returns an array whose string key names are all in lowercase or uppercase.
Array_chunk -- splits an array into multiple
Array_combine -- creates an array with the value of one array as its key name and the value of another array as its value
Array_count_values -- count the number of occurrences of all values in the array
Array_diff_assoc -- calculate the array's difference set with index check
Array_diff_key -- use the key name to compare the difference set of the calculated array
Array_diff_uassoc -- use the callback function provided by the user for index check to calculate the array's difference set
Array_diff_ukey -- use the callback function to compare the difference set of the calculated array with the key name
Array_diff -- calculate the difference set of the array
Array_fill -- fill the array with the given value
Array_filter -- use the callback function to filter elements in the array.
Array_flip -- exchange keys and values in an array
Array_intersect_assoc -- Intersection of arrays computed by checking indexes
Array_intersect_key -- use the key name to compare and calculate the intersection of arrays
Array_intersect_uassoc -- calculates the intersection of arrays with index check and compares indexes with callback functions.
Array_intersect_ukey -- use the callback function to compare key names to calculate the intersection of arrays
Array_intersect -- calculates the intersection of arrays
Array_key_exists -- check whether the given key name or index exists in the array
Array_keys -- returns all the key names in the array.
Array_map -- calls the callback function to the unit of the given array.
Array_merge_recursive -- recursively merges one or more arrays
Array_merge -- merge one or more arrays
Array_multisort -- sorts multiple arrays or multi-dimensional arrays.
Array_pad -- fill the array with a value to the specified length
Array_pop -- bring up the last unit of the array (output stack)
Array_product -- calculate the product of all values in the array
Array_push -- push one or more units to the end of the array (into the stack)
Array_rand -- randomly retrieve one or more units from the array
Array_reduce -- use the callback function to iteratively simplify the array to a single value
Array_reverse -- returns an array with the opposite unit order.
Array_search -- search for a given value in the array. if the value is successful, the corresponding key name is returned.
Array_shift -- removes elements starting with an array from the array
Array_slice -- extract a segment from the array
Array_splice -- remove part of the array and replace it with other values
Array_sum -- calculate the sum of all values in the array
Array_udiff_assoc -- calculate the difference set of the array with index check, and use the callback function to compare data
Array_udiff_uassoc -- calculate the difference set of the array with index check, and use the callback function to compare data and indexes.
Array_udiff -- use the callback function to compare data to calculate the difference set of the array
Array_uintersect_assoc -- calculates the intersection of arrays with index check and compares data with callback functions.
Array_uintersect_uassoc -- calculates the intersection of arrays with index check, and compares data and indexes with callback functions.
Array_uintersect -- calculates the intersection of arrays and compares data with callback functions.
Array_unique -- Remove repeated values from the array
Array_unshift -- insert one or more units at the beginning of the array
Array_values -- returns all values in the array.
Array_walk_recursive -- recursively applies user functions to each member in the array
Array_walk -- apply user functions to each member in the array
Array -- create an array
Arsort-sorts arrays in reverse order and maintains the index relationship.
Asort -- sorts arrays and maintains the index relationship.
Compact -- create an array, including variable names and their values
Count -- calculates the number of units in the array or the number of attributes in the object.
Current -- returns the current unit in the array.
Each -- returns the current key/value pair in the array and moves the array pointer one step forward.
End -- points the internal pointer of the array to the last unit.
Extract -- import the variable from the array to the current symbol table
In_array -- check whether a value exists in the array
Key -- get the key name from the joined array
Krsort-sort the array in reverse order by key name
Ksort -- sort the array by key name
List -- assign values in the array to some variables
Natcasesort-use the "natural sorting" algorithm to sort arrays by case-insensitive letters
Natsort -- sort arrays using the "natural sorting" algorithm
Next -- move the internal pointer in the array to a forward position
Alias of pos -- current ()
Prev -- returns the internal pointer of the array to one
Range -- create an array containing the specified range units
Reset -- point the internal pointer of the array to the first unit
Rsort -- reverse sorting of arrays
Shuffle -- disrupt the array
Sizeof -- count () alias
Sort -- sort arrays
Uasort -- sort the values in the array using the user-defined comparison function and maintain the index Association
Uksort -- sort the key names in the array using the user-defined comparison function
Usort -- sort the values in the array using the user-defined comparison function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.