I am writing a foreach that does not start at the 0th index but instead starts at the first index of my array. Is there any way to offset the loop\'s starting p
foreach
You can use the array_slice function:
$arr = array(); // your array foreach(array_slice($arr, 1) as $foo){ // do what ever you want here }
Of course, you can use whatever offset value you want. In this case, 1 'skip' the first element of the array.
1