When you write PHP programs, you often need to repeat the same task multiple times.
For example:
Display numbers from 1 to 10
Show a list of students
Print table rows from database records
Generate repeated HTML elements
Instead of writing the same code again and again, PHP provides loops.
One of the most commonly used loops is the PHP for loop.
This guide explains the PHP for loop in a clear, teacher-style, beginner-friendly way, so you can understand it even if you are learning PHP for the first time.