Php Ref Array
* * *
## PHP Array Introduction
PHP Array functions allow you to access and manipulate arrays.
Supports both simple and multidimensional arrays.
* * *
## Installation
The PHP Array functions are part of the PHP core. These functions can be used without any installation.
* * *
## PHP 5 Array Functions
| Function | Description |
| --- | --- |
| [array()]( | Creates an array. |
| [array_change_key_case()]( | Returns an array with all keys in uppercase or lowercase. |
| [array_chunk()]( | Splits an array into chunks. |
| [array_column()]( | Returns the values from a single column in the input array. |
| [array_combine()]( | Creates a new array by combining two arrays (one for keys, one for values). |
| [array_count_values()]( | Used to count the number of occurrences of all values in an array. |
| [array_diff()]( | Compares arrays and returns the difference between two arrays (compares only values). |
| [array_diff_assoc()]( | Compares arrays and returns the difference between two arrays (compares keys and values). |
| [array_diff_key()]( | Compares arrays and returns the difference between two arrays (compares only keys). |
| [array_diff_uassoc()]( | Compares arrays and returns the difference between two arrays (compares keys and values using a user-defined key comparison function). |
| [array_diff_ukey()]( | Compares arrays and returns the difference between two arrays (compares only keys using a user-defined key comparison function). |
| [array_fill()]( | Fills an array with the specified values. |
| [array_fill_keys()]( | Fills an array with the specified values using given keys. |
| [array_filter()]( | Filters array elements using a callback function. |
| [array_flip()]( | Reverses/switches the keys and their associated values in an array. |
| [array_intersect()]( | Compares arrays and returns the intersection of two arrays (compares only values). |
| [array_intersect_assoc()]( | Compares arrays and returns the intersection of two arrays (compares keys and values). |
| [array_intersect_key()]( | Compares arrays and returns the intersection of two arrays (compares only keys). |
| [array_intersect_uassoc()]( | Compares arrays and returns the intersection of two arrays (compares keys and values using a user-defined key comparison function). |
| [array_intersect_ukey()]( | Compares arrays and returns the intersection of two arrays (compares only keys using a user-defined key comparison function). |
| [array_key_exists()]( | Checks if a specified key exists in an array. |
| [array_key_first()]( | Gets the first key value of a specified array. |
| [array_key_last()]( | Gets the last key value of a specified array. |
| [array_keys()]( | Returns all keys in an array. |
| [array_map()]( | Applies a user-defined function to each value of a given array and returns new values. |
| [array_merge()]( | Merges one or more arrays into a single array. |
| [array_merge_recursive()]( | Recursively merges one or more arrays into a single array. |
| [array_multisort()]( | Sorts multiple arrays or multi-dimensional arrays. |
| [array_pad()]( | Inserts a specified number of elements with a specified value into an array. |
| [array_pop()]( | Removes the last element from an array (pops from the stack). |
| [array_product()]( | Calculates the product of all values in an array. |
| [array_push()]( | Inserts one or more elements at the end of an array (pushes onto the stack). |
| [array_rand()]( | Randomly selects one or more elements from an array and returns their keys. |
| [array_reduce()]( | Iteratively reduces an array to a single string using a user-defined function and returns it. |
| [array_replace()]( | Replaces the values of the first array with values from subsequent arrays. |
| [array_replace_recursive()]( | Recursively replaces the values of the first array with values from subsequent arrays. |
| [array_reverse()]( | Reverses the order of elements in the original array, creates a new array, and returns it. |
| [array_search()]( | Searches for a given value in an array; if successful, returns the corresponding key. |
| [array_shift()]( | Removes the first element from an array and returns the value of the removed element. |
| [array_slice()]( | Returns a portion of an array. |
| [array_splice()]( | Removes specified elements from an array and replaces them with other values. |
| [array_sum()]( | Returns the sum of all values in an array. |
| [array_udiff()]( | Compares arrays and returns the difference between two arrays (compares only values using a user-defined key comparison function). |
| [array_udiff_assoc()]( | Compares arrays and returns the difference between two arrays (compares keys and values; uses built-in function for key comparison, user-defined function for value comparison). |
| [array_udiff_uassoc()]( | Compares arrays and returns the difference between two arrays (compares keys and values using two user-defined key comparison functions). |
| [array_uintersect()]( | Compares arrays and returns the intersection of two arrays (compares only values using a user-defined key comparison function). |
| [array_uintersect_assoc()]( | Compares arrays and returns the intersection of two arrays (compares keys and values; uses built-in function for key comparison, user-defined function for value comparison). |
| [array_uintersect_uassoc()]( | Compares arrays and returns the intersection of two arrays (compares keys and values using two user-defined key comparison functions). |
| [array_unique()]( | Removes duplicate values from an array. |
| [array_unshift()]( | Inserts one or more elements at the beginning of an array. |
| [array_values()]( | Returns all values in an array. |
| [array_walk()]( | Applies a user function to each member of an array. |
| [array_walk_recursive()]( | Recursively applies a user function to each member of an array. |
| [arsort()]( | Sorts an associative array in descending order by value. |
| [asort()]( | Sorts an associative array in ascending order by value. |
| [compact()]( | Creates an array containing variable names and their values. |
| [count()]( | Returns the number of elements in an array. |
| [current
YouTip