Definition
The array_shift() function removes the first element from an array, and returns the value of the removed element.
Syntax
array_shift(array)
Parameters
Parameter | Description |
---|---|
array |
Required. Specifies an array. |
Example
<?php
// Example
$ages = array("Mark" => 22, "Jeff" => 32, "Mike" => 28);
echo array_shift($ages);
echo "<br>";
print_r($ages);