$stack = array("orange", "banana", "apple", "raspberry"); $last_value = array_pop($stack); // return "raspberry" $first_value = array_shift(array_values($stack)); // return "orange"
$stack = array("orange", "banana", "apple", "raspberry"); $last_value = array_pop($stack); // return "raspberry" $first_value = array_shift(array_values($stack)); // return "orange"