Grouping induction of PHP array functions

Source: Internet
Author: User

Statistics:

Array_count_values the number of occurrences of all values in the statistics array

Array_product computes the product of all values in an array
Array_sum computes the and of all values in the array
Count counts the number of cells in an array or the number of properties in an object
The alias of sizeof Count ()


Search:
Array_key_exists checks whether the given key name or index exists in the array
Array_search searches for the given value in the array, and returns the corresponding key name if successful
In_array checks if a value exists in the array


Sort:
Array_multisort to sort multiple arrays or multidimensional arrays
Arsort an array in reverse order and maintain an index relationship
Asort sorting an array and maintaining an index relationship
Krsort an array in reverse order by key name
Ksort sorting arrays by key name
Natcasesort sorting of case-insensitive letters using the "natural sort" algorithm for arrays
Natsort using the "natural sort" algorithm to sort arrays
Rsort reverse sequence of an array
Sort array Sorting
Uasort use a user-defined comparison function to sort the values in the array and keep the index associated
Uksort using a user-defined comparison function to sort the key names in an array
Usort using a user-defined comparison function to sort values in an array
Shuffle array is scrambled


Intersection:
ARRAY_INTERSECT_ASSOC with index Check the intersection of computed arrays
Array_intersect_key calculating the intersection of an array using the key name comparison
ARRAY_INTERSECT_UASSOC with index Check the intersection of computed arrays, using callback function to compare indexes
Array_intersect_ukey computes the intersection of an array using a callback function to compare the key names
Array_intersect computes the intersection of an array
Array_key_exists computes the intersection of an array using a callback function to compare the key names
ARRAY_UINTERSECT_ASSOC with index Check the intersection of the computed array, using the callback function to compare the data
Array_uintersect computes the intersection of an array, compares the data with a callback function


Subtraction
ARRAY_UDIFF_ASSOC with index Check the difference set of the computed array, using the callback function to compare the data
ARRAY_UDIFF_UASSOC with index Check to calculate the difference of the array, compare the data and index with the callback function
Array_udiff comparing data with callback functions to calculate the difference set of an array
ARRAY_DIFF_ASSOC with index Check the difference set of the computed array
Array_diff_key Calculating the difference set of an array using the key name comparison
ARRAY_DIFF_UASSOC uses the user-supplied callback function to do an index check to calculate the difference set of the array
Array_diff_ukey using a callback function to compare the difference set of an array to a key name
Array_diff Calculating the difference set of an array


Gets the partial contents of the array:
Array_chunk splits an array into multiple
Array_filter filter cells in an array with callback functions
Array_keys returns all the key names in the array
Array_slice remove a paragraph from an array
Array_values returns all values in the array


To process the desired array:
Array_combine creates an array with the value of an array as its key name, and the value of another array as its value
Array_fill fills an array with the given value
Array_flip exchanging keys and values in an array
Array_map the callback function to the cell of the given array
Array_merge_recursive to merge one or more arrays recursively
Array_merge merging one or more arrays
Array_pad fills an array to a specified length with a value
Array_push pressing one or more cells into the end of the array (into the stack)
Array_reverse returns an array of cells in reverse order
Array_shift moves the cell at the beginning of the array to a group
Array_splice remove part of the array and replace it with other values
Array_unique duplicate values in an array
Array_unshift inserting one or more cells at the beginning of an array
Array_walk_recursive applying user functions recursively to each member in an array
Array_walk applying user functions to each member in an array
Compact establishes an array, including the variable names and their values
Range to create an array containing the specified range of cells


Unit:
Array_pop pops the last cell of the array (out of the stack)
Array_rand random extraction of one or more cells from an array
Current returns the cell in the array
Alias for POS Current ()
Each returns the current key/value pair in the array and moves the array pointer forward one step
End points The inner pointer of the array to the last cell
Key returns the key name of the current cell in the array
List assigns the values in the array to some variables
Next moves the inner pointer in the array forward by one
Prev The internal pointer of the array back to a
Reset points The inner pointer of the array to the first cell


Other:
Array_reduce iteratively to simplify the array to a single value with a callback function
Extract importing variables from an array into the current symbol table
Array to create a new arrays

Grouping induction of PHP array functions

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.