Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP: for loop with continue
// If "i" is equal to 5, skip the echo statement below and continue evaluating the condition.
<?php
for($i=0; $i<=10; $i++) {
echo $i;
if($i==10) {
continue;
}
echo ", ";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment