Jump to content

Question about the 'continue' command


PHPCodemania

Recommended Posts

The 'continue' keyword in this case, is actually referring to the while loop its inside. The 'continue' indicates that you finish the current loop of the while, and continue onto the next. The reason why the numbers are skipped, is because the loop is 'continued' before the output is sent.

Link to comment
Share on other sites

17 hours ago, PHPCodemania said:

Ohh I totally get it now - I think I failed to see the "$x++" action was at the end of the process and was confused as to why things were working the way they did.

 

Thanks very much for your reply!!

Probably more closer to the answer, is that there's two lots of $x++  in the loop in the second example. So you're incrementing by two each time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...