Created
October 5, 2012 02:35
-
-
Save johndugan/3837750 to your computer and use it in GitHub Desktop.
PHP: for loop with continue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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