array_shift

Shift an element off the beginning of array

Syntax

array_shift ( array &$array ) : mixed

Parameters

array

The input array.

Return

Returns the shifted value, or NULL if array is empty or is not an array.

Examples

<?

$array = array("orange", "banana", "apple", "raspberry");

$return = array_shift($array);

print_r($return);

?>
orange

Internal

array_pop

array_push

array_unshift

External

PHP

Home Menu