PHP array_shift() Function is used to remove the first element from an array and returned with shifted value at beginning . The array_shift() is a built-in function of PHP.
If the keys are numeric, all elements will get new keys and starting from 0 and increases by 1.
If index key is string, then all elements will remain same keys assigned in array.
$array : Required It is type of array parameter.
Return : It returns array with removed first element and shifted value. If array is empty, or is not an array, NULL will be returned.
Let's see below example to understand php array_shift() Function in details.
At below example, array_shift() function removes PHP value from $tutorials array and other values starts at 0 index because index key is numeric key.