Skip to content

Instantly share code, notes, and snippets.

@johndugan
Created October 5, 2012 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndugan/3837750 to your computer and use it in GitHub Desktop.
Save johndugan/3837750 to your computer and use it in GitHub Desktop.
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