*/
$ Input = array ("a", "B", "c", "d", "e"); // defines the original array
$ Output = array_slice ($ input, 2); // return "c", "d", and "e"
$ Output = array_slice ($ input,-2, 1); // return "d"
$ Output = array_slice ($ input,); // return "a", "B", and, "c"
Print_r (array_slice ($ input, 2,-1); // return c, d without retaining the key name
Print_r (array_slice ($ input, 2,-1, true); // returns the reserved key names of c and d.
//
$ Array = array ('blue', 'red', 'green', 'red'); // defines the original array
$ Key = array_search ('green', $ array); // search for green and return 2;
Echo $ key;
Echo "<br> ";
$ Key = array_search ('red', $ array); // search for red to return key 1 of the first red
Echo $ key;
//
$ Array = array ("orange", "banana", "apple", "rasp tutorial berry"); // defines the initial array
$ Result = array_shift ($ array); // remove
Print_r ($ result); // display the pop-up element
Echo "<br> ";
Print_r ($ array );
//
$ Input = array ("a" => "green", "red", "B" => "green", "blue", "red "); // define the original array
$ Result = array_unique ($ input); // perform the remove operation.
Print_r ($ result );
//
$ Array = array ("orange", "banana"); // defines the original array
$ Result = array_unshift ($ array, "apple", "raspberry"); // execute the insert operation.
Print_r ($ result); // display the result
Echo "<br> ";
Print_r ($ array );