Loops let you execute a block of code multiple times. PHP supports four main loop types.
for Loop
Best when you know the number of iterations in advance.
while Loop
Repeats as long as the condition is true. Good when you don't know the count.
do-while Loop
Always executes at least once, then checks the condition.
foreach Loop
Specifically designed for iterating over arrays.
Loop Control
break— Exit the loop immediatelycontinue— Skip to the next iteration