Skip to content

Instantly share code, notes, and snippets.

Created October 5, 2012 02:26
What would you like to do?
PHP: for loop with break
// If "i" is equal to 10, break out of the loop and ignore the echo statement below.
for($i=0; $i<=10; $i++) {
echo $i;
if($i==10) {
echo ", ";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment