array_shift

(PHP4 )

array_shift --  Pop an element off the beginning of array

Description

mixed array_shift (array array)

Array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down.

Példa 1. Array_shift() example

  1 
  2 $args = array ("-v", "-f");
  3 $opt = array_shift ($args);
  4       

This would result in $args having one element "-f" left, and $opt being "-v".

See also array_unshift(), array_push(), and array_pop().