PHP Array
23 functions
countcount(array $array): intCounts all elements in an array.
array_pusharray_push(array &$array, mixed ...$values): intPushes one or more elements onto the end of array.
array_poparray_pop(array &$array): mixedPops the element off the end of array.
array_shiftarray_shift(array &$array): mixedShifts an element off the beginning of array.
array_unshiftarray_unshift(array &$array, mixed ...$values): intPrepends one or more elements to the front of an array.
array_mergearray_merge(array ...$arrays): arrayMerges one or more arrays together.
array_slicearray_slice(array $array, int $offset, ?int $length): arrayExtracts a slice of the array.
array_searcharray_search(mixed $needle, array $haystack): int|string|falseSearches the array for a given value and returns the key if successful.
in_arrayin_array(mixed $needle, array $haystack): boolChecks if a value exists in an array.
array_key_existsarray_key_exists(string|int $key, array $array): boolChecks if the given key exists in the array.
array_keysarray_keys(array $array): arrayReturns all the keys of an array.
array_valuesarray_values(array $array): arrayReturns all the values of an array.
array_uniquearray_unique(array $array): arrayRemoves duplicate values from an array.
array_reversearray_reverse(array $array): arrayReturns an array with elements in reverse order.
sortsort(array &$array): trueSorts an array in ascending order.
usortusort(array &$array, callable $callback): trueSorts an array by values using a user-defined comparison function.
array_maparray_map(?callable $callback, array $array): arrayApplies the callback to the elements of the given array.
array_filterarray_filter(array $array, ?callable $callback): arrayFilters elements of an array using a callback function.
array_reducearray_reduce(array $array, callable $callback, mixed $initial): mixedIteratively reduces the array to a single value using a callback function.
array_columnarray_column(array $array, int|string|null $column): arrayReturns the values from a single column in the input array.
array_chunkarray_chunk(array $array, int $length): arraySplits an array into chunks.
array_combinearray_combine(array $keys, array $values): arrayCreates an array by using one array for keys and another for its values.
array_fliparray_flip(array $array): arrayExchanges all keys with their associated values in an array.
