PHP array_shift() function
The array_shift() function is an inbuilt function of PHP. The array_shift( ) function is used to remove the first element from an array, and returns the value of the removed element. This function was introduced in PHP 4.0.
The array_shift( ) function returns the value of the removed element from an array. If the array is empty, it will return NULL.
Important note: If the keys are numeric, all elements will get new keys, starting from 0 and increases by 1.
testArray (  => one day  => t20 )
Array (  => math  =>english  =>hindi ) Science
200Array ( [sehwag] => 400 [ganguly] => 500 [yuvraj] => 100 )
TCSArray (  => Infosys  =>Mindtree )