What is array_shift?
array_shift — Shift an element off the beginning of array
Returns the shifted value, or NULL if array is empty or is not an array.
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_shift($stack);
 => banana
 => apple
 => raspberry
9/27/2012 05:55:10 am
I've found plenty of articles like this explaining what it does, but not why. What use is it? Why would you want to get rid of the orange out of the array (in your example)?
Leave a Reply.