HCProfessionals Posted April 3, 2011 Share Posted April 3, 2011 $i = 0; while($i < 10) { if ($i == 7) { //Do Function } else { $i++ Go back to beginning of loop } //More if statements here. } Quote Link to comment Share on other sites More sharing options...
dcro2 Posted April 3, 2011 Share Posted April 3, 2011 You mean... continue? It'll skip the rest of the loop and begin the next iteration. $i = 0; while($i < 10) { if ($i == 7) { //Do Function } else { $i++ continue; //Go back to beginning of loop } //More if statements here. } Quote Link to comment Share on other sites More sharing options...
HCProfessionals Posted April 3, 2011 Author Share Posted April 3, 2011 Cannot break/continue 1 level Quote Link to comment Share on other sites More sharing options...
dcro2 Posted April 3, 2011 Share Posted April 3, 2011 Is that an error? Sorry, I did miss a semicolon at the end of $i++. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.