The loop statement: for, do...while, foreach and we add break - continue statement in PHP.
Loops in PHP are used to execute the same block of code a specified number of times. We are discussing PHP supports following four loop types: for, while, do...while, foreach.
We will discuss about continue and break keywords used to control the loops execution.
For loop in PHP statement.
Syntax
for (initialization; condition; increment)
{
code to be executed;
}
{
code to be executed;
}
Example of statement - for loop PHP-
<?php
$a
$a
Users replays
0 results
- Add your answer -