PHP Array Functions

EditRocket provides the following information on Array functions in the PHP source code builder.

-

array array_change_key_case ( array $input [, int $case ] ) - Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.

array array_chunk ( array $input , int $size [, bool $preserve_keys ] ) - Chunks an array into size large chunks. The last chunk may contain less than size elements.

array array_combine ( array $keys , array $values ) -

array array_count_values ( array $input ) - array_count_values() returns an array using the values of the input array as keys and their frequency in input as values.

array array_diff ( array $array1 , array $array2 [, array $ ... ] ) - Compares array1 against array2 and returns the difference.

array array_diff_assoc ( array $array1 , array $array2 [, array $... ] ) - Compares array1 against array2 and returns the difference.

array array_diff_key ( array $array1 , array $array2 [, array $... ] ) - Compares the keys from array1 against the keys from array2 and returns the difference.

array array_diff_uassoc ( array $array1 , array $array2 [, array $... ], callback $key_compare_func ) - Compares array1 against array2 and returns the difference.

array array_diff_ukey ( array $array1 , array $array2 [, array $ ... ], callback $key_compare_func ) - Compares the keys from array1 against the keys from array2 and returns the difference.

array array_fill ( int $start_index , int $num , mixed $value ) - Fills an array with num entries of the value of the value parameter, keys starting at the start_index parameter.

array array_fill_keys ( array $keys , mixed $value ) - Fills an array with the value of the value parameter, using the values of the keys array as keys.

array array_filter ( array $input [, callback $callback ] ) - Iterates over each value in the input array passing them to the callback function. If the callback function returns true, the current value from input is returned into the result array. Array keys are preserved.

array array_flip ( array $trans ) -

array array_intersect ( array $array1 , array $array2 [, array $ ... ] ) - array_intersect() returns an array containing all the values of array1 that are present in all the arguments. Note that keys are preserved.

array array_intersect_assoc ( array $array1 , array $array2 [, array $ ... ] ) -

array array_intersect_key ( array $array1 , array $array2 [, array $ ... ] ) - array_intersect_key() returns an array containing all the values of array1 which have matching keys that are present in all the arguments.

array array_intersect_uassoc ( array $array1 , array $array2 [, array $ ... ], callback $key_compare_func ) - array_intersect_uassoc() returns an array containing all the values of array1 that are present in all the arguments.

array array_intersect_ukey ( array $array1 , array $array2 [, array $... ], callback $key_compare_func ) - array_intersect_ukey() returns an array containing all the values of array1 which have matching keys that are present in all the arguments.

bool array_key_exists ( mixed $key , array $search ) - array_key_exists() returns TRUE if the given key is set in the array. key can be any value possible for an array index. array_key_exists() also works on objects.

array array_keys ( array $input [, mixed $search_value [, bool $strict ]] ) - array_keys() returns the keys, numeric and string, from the input array.

array array_map ( callback $callback , array $arr1 [, array $... ] ) - array_map() returns an array containing all the elements of arr1 after applying the callback function to each one. The number of parameters that the callback function accepts should match the number of arrays passed to the array_map()

-

array array_merge_recursive ( array $array1 [, array $... ] ) - array_merge_recursive() merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array.

-

array array_pad ( array $input , int $pad_size , mixed $pad_value ) - array_pad() returns a copy of the input padded to size specified by pad_size with value pad_value. If pad_size is positive then the array is padded on the right, if it's negative then on the left. If the absolute value of pad_size is less than or equal to the length of the input then no padding takes place. It is possible to add most 1048576 elements at a time.

mixed array_pop ( array &$array ) - array_pop() pops and returns the last value of the array, shortening the array by one element. If array is empty (or is not an array), NULL will be returned.

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

bool asort ( array &$array [, int $sort_flags ] ) - Sort an array and maintain index association

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-