array functions API Reference
PHP's built-in array functions — PHP arrays serve as both lists and ordered maps.
array functions
Procedural array functions for manipulating PHP's versatile array type.
array_push(array &$array, mixed ...$values): intPushes one or more elements onto the end of array. Returns the new number of elements.
Returns: int
array_pop(array &$array): mixed|nullPops and returns the last value of the array, shortening it by one element.
Returns: mixed|null
count(Countable|array $value, int $mode = COUNT_NORMAL): intCounts all elements in an array or Countable object.
Returns: int
array_map(?callable $callback, array $array, array ...$arrays): arrayApplies the callback to the elements of the given arrays and returns a new array.
Returns: array
array_filter(array $array, ?callable $callback = null, int $mode = 0): arrayFilters elements of an array using a callback. Without a callback, removes falsy values.
Returns: array
array_merge(array ...$arrays): arrayMerges the elements of one or more arrays together. Re-indexes numeric keys.
Returns: array
in_array(mixed $needle, array $haystack, bool $strict = false): boolChecks if a value exists in an array. Use strict=true for type-safe comparison.
Returns: bool