PHPize Online / SQLize Online

Articles    Popular

array_pop

Tags: PHP 5.x PHP 7.x PHP 8.x

array_pop — Pop the element off the end of array
array_pop(
    array &$array
): mixed
array_pop() pops and returns the value of the last element of array, shortening the array by one element.

Note: This function will reset() the array pointer of the input array after use.

Parameters

array
The array to get the value from.

Return Values

Returns the value of the last element of array. If array is empty (or is not an array), null will be returned.