Tag Archive: shift

Mar 21

Array Shift and Unshift

Array_Shift : Shift an element off the beginning of array. Syntax : array_shift ( $arrval ) array_shift() shifts the first value of the array off and returns it. Return the shift value or null if array is empty. Example: $arrval = array(“test”, “test1”, “test2”, “test3”); $shiftval = array_shift($arrval); print_r($arrval); Output: array( [0] => test1 [1] => test2 [2] …

Continue reading »