Introducing the different PHP Loops
Loops are similar to conditional statements like if/else except that they continue to run infinitely until a certain condition is met that tells them to stop. This is very powerfull and of course potentially very problematic because their is always the risk of creating a loop which never ends and thus causes your application to stall forever. Don’t be scared though, loops are awesome! Although I do not approve of slavery, loops pretty much are slaves. You just need to tell them what to do, and they’ll get to work on it right away! You can compute hundreds of thousands of calculations in seconds because your loops will never take a coffee break.
PHP gives your three different types of slaves… err I mean loops.
Click the above links to find out more about each of the different types of loops. You’ll start to see what I meant when I said loops are extremely useful when used with arrays.
Leave a Reply