PHP array_shift() Function

The array_shift() function is used to remove the first element from an array, and returns the value of the removed element.All numerical array keys will be modified to start counting from zero while literal keys won't be touched.array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array keys will be modified to start counting from zero while literal keys won't be touched.

Example -

Example -