Remove all elements before x from an array php -
if give you:
$array = array(object1, object2, object3, object4);
and say, @ position 2, remove elements before position end result is:
$array = array(object3, object4);
what do? looking @ array_shift
, array_splice
achieve wanted - how ever not sure use or how use them achieve desired affect.
use array_slice. more detail check link http://php.net/manual/en/function.array-slice.php
$array = array(object1, object2, object3, object4); $array = array_slice($array,2); // 2 position
Comments
Post a Comment