Smashing Magazine. PHP Help Tutorial: PHP Loops. What is a Loop? Looping is simply a way for you to reduce the amount of code and/or content you have to write out. The idea is that you have something you have to do, or some content you have to show, and instead of just "writing it all out," you find a pattern to it - a common denominator - and let PHP execute the code or generate the content piece by piece using that pattern, based on a condition. A condition is a way of letting PHP know how many times to run your loop, or when to stop running your loop. The ability to take a condition and execute a set of instructions over and over as long as that condition is true is one of the basic cornerstones of programming.
To demonstrate how loops work, we will use a "for" loop to solve the following example problem: "Joe wants to be able to take a range of numbers and find out how many numbers are divisible by a certain number, within that range of numbers The Code <? // echo out the formecho $form; What We Care About Let's Get Loopy $x = $start; a b c. Welcome to The Apache Software Foundation! PHP: Hypertext Preprocessor. W3Schools Online Web Tutorials.