As already mentioned, you can use a for loop (only if you have number keys) or continue . Another alternative is to use the list and each iteration method, which allows you to move the array pointer with next , prev , etc. (Since it does not create a copy of an array of type foreach ). ):
$array = array(1,2,3,4,5); while (list($key, $value) = each($array)) { echo $value; next($array); }
It will display:
024
source share