Dreamhost

Looking for somewhere to host your site? Browse our PHP web hosts section!

Home > Quick Reference Library > Date and Time Functions

Array Functions

array_push
Push one or more elements onto the end of array
array_rand
Pick one or more random entries out of an array
array_reduce
Iteratively reduce the array to a single value using a callback function
array_reverse
Return an array with elements in reverse order
array_search
Searches the array for a given value and returns the corresponding key if successful
array_shift
Shift an element off the beginning of array
array_slice
Extract a slice of the array
array_splice
Remove a portion of the array and replace it with something else
array_sum
Calculate the sum of values in an array
array_udiff_assoc
Computes the difference of arrays with additional index check. The data is compared by using a callback function
array_udiff_uassoc
Computes the difference of arrays with additional index check. The data is compared by using a callback function. The index check is done by a callback function also
array_udiff
Computes the difference of arrays by using a callback function for data comparison
array_unique
Removes duplicate values from an array
array_unshift
Prepend one or more elements to the beginning of an array
array_values
Return all the values of an array
array_walk
Apply a user function to every member of an array
array
Create an array
arsort
Sort 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

More Array functions