1$colors = array(2=>"blue",3 =>"green",1=>"red");
2$firstValue = reset($colors); //blue
3$firstKey = key($colors); //2
1$alphabet = array("a", "b", "c", "d", "e","g","h","i","j","k");
2$firstFive = array_slice($alphabet, 0, 5); //get first 5 elements of array
1<?php
2$stack = array("orange", "banana", "apple", "raspberry");
3$fruit = array_shift($stack); //Remove "orange" from array and return it
4print_r($stack);
5/** OUTPUT:
6Array
7(
8 [0] => banana
9 [1] => apple
10 [2] => raspberry
11)
12*/
13?>