Articles → PHP → Loops In PHP
Loops In PHP
- XAMPP is installed on your machine
- Any text editor like Notepad
- Basics about PHP?
- What are arrays in PHP?
What Are Loops?
- A structure, series, or process, the end of which is connected to the beginning
- A shape produced by a curve that bends round and crosses itself
Types Of Loops
- for loop
- while loop
- foreach loop
- do..while loop
- initialize counter → Initialize the value of the counter from which the loop begins to execute
- Test counter → Every time the code block gets executed, for loop checks if the counter reaches the specific value (specified in the test counter). If no then for loop executes the block again or else exits the loop
- Increment counter → increments the value of the counter with a specific value