PHP For Loop
Syntax
The for loop in PHP is used to iterate through a block of code a predetermined number of times, making it ideal for scenarios where the iteration count is known.
// Generic version of a for loopfor (initialization; condition; increment) { // Code to execute in each iteration}Example
// Concrete example of a for loopfor ($i = 1; $i <= 5; $i++) { echo "$i ";}// Output: 1 2 3 4 5