From an array in PHP for example:
array(
[0] => "A",
[1] => "B",
[2] => "C",
[3] => "D"
)
How can I get an array containing the keys after the fisrt one. So the example will be:
array(
[0] => "B",
[1] => "C",
[2] => "D"
)
array_shift is a possibility.
$output = array_shift($input);
array_slice() is one way:
$result = array_slice($array, 1);
array_slice
returns a subsequence of an array.
array_slice($array, 1);
array_shift($array);
array_shift
modifies the array as a reference. If you need the value that is shifted, simply assign it to a variable.