PHP array function Daquan

PHP array functions

PHP array functions are part of the core. No installation needed to use these functions

Function name description
array_change_key_case All keys array changed to lowercase or all uppercase
array_chunk The array is divided into a plurality of
array_column Returns an array specified
array_combine Create an array with the values ​​of an array as its key name, the value of another array as its value
array_count_values Statistics array of all the values
array_diff_assoc Check the calculated difference with a set index array
array_diff_key Comparing the calculated difference using the keys of arrays
array_diff_uassoc Callback function with the user supplied check, and the difference of arrays
array_diff_ukey Comparing the calculated difference of arrays using a callback function to the keys
array_diff Calculating a difference set arrays
array_fill_keys The specified key value and fill an array
array_fill Filled with a given array of values
array_filter Using a callback function units filter array
array_flip Exchange of keys and values ​​in the array
array_intersect_assoc Check the calculated intersection indexed arrays
array_intersect_key Using keys for comparison computing the intersection of arrays
array_intersect_uassoc Check the calculated intersection indexed arrays, comparison index using a callback function
array_intersect_ukey Using a callback function that compares keys to calculate the intersection of arrays
array_intersect Computes the intersection of arrays
array_key_exists Check the array if there is a specified key or index
array_key_first Gets the first key of an array
array_key_last Gets the last key of an array
array_keys Returns an array of part or all of the keys
array_map Application callback function for each element of the array
array_merge_recursive Recursively merging one or more arrays
array_merge Incorporating one or more arrays
array_multisort Multiple arrays or multidimensional array sort
array_pad To specify the length of the array into a filling value
array_pop Pop last cell array (the stack)
array_product The product of all the values ​​in the array
array_push One or more elements onto the end of an array (stack)
array_rand One or more elements taken randomly from the array
array_reduce Iteratively reduce the array to a single value using a callback function
array_replace_recursive Using the passed array recursively replace the first element of the array
array_replace A first transfer element array using an array of alternative
array_reverse Returns the reverse order array element
array_search Search for a given value in the array, if successful, the first name of the corresponding key is returned
array_shift The beginning of the array out of the array element
array_slice Removed from the array section
array_splice Removing a portion of the array and replace it with something else
array_sum Sum of all values ​​in the array
array_udiff_assoc Check the calculated difference between the set indexed array, comparison data with a callback function
array_udiff_uassoc Check the index calculated with the difference of arrays, and the comparison data with a callback function index
array_udiff Comparative data with a callback function to calculate the difference of arrays
array_uintersect_assoc Check the index calculated with the intersection of arrays, compares data by a callback function
array_uintersect_uassoc Check the calculated intersection indexed arrays, with the individual data and the index comparing callback
array_uintersect Computing the intersection of arrays, compares data by a callback function
array_unique Removing duplicate values ​​in array
array_unshift Insertion of one or more units at the beginning of the array
array_values Return all the values ​​in the array
array_walk_recursive Each member of an array Apply a user function recursively
array_walk User-defined function to do a callback handler to each element in the array
array Create an array
arsort An array in reverse order and maintain index association
asort Sort an array and maintain index association
compact Create array containing variables and their values
count Calculating the number of cells in the array, the number of the object or attributes
current 返回数组中的当前单元
end 将数组的内部指针指向最后一个单元
extract 从数组中将变量导入到当前的符号表
in_array 检查数组中是否存在某个值
key_exists 别名 array_key_exists
key 从关联数组中取得键名
krsort 对数组按照键名逆向排序
ksort 对数组按照键名排序
list 把数组中的值赋给一组变量
natcasesort 用“自然排序”算法对数组进行不区分大小写字母的排序
natsort 用“自然排序”算法对数组排序
next 将数组中的内部指针向前移动一位
pos current 的别名
prev 将数组的内部指针倒回一位
range 根据范围创建数组,包含指定的元素
reset 将数组的内部指针指向第一个单元
rsort 对数组逆向排序
shuffle 打乱数组
sizeof count 的别名
sort 对数组排序
uasort 使用用户自定义的比较函数对数组中的值进行排序并保持索引关联
uksort 使用用户自定义的比较函数对数组中的键名进行排序
usort 使用用户自定义的比较函数对数组中的值进行排序

Guess you like

Origin blog.51cto.com/13578973/2439584