Loop will execute a statement number of time depends on a
condition
PHP supports all stranded loops
1. While
If will execute the statement n-number of times each time
verify first condition and then execute statement.
2. Do While
It will execute the statement first and then verify the
condition for first iteration only but remaining iterations executes depends on
condition.
3. For
It is also similar to while loop but it will work only for
fixed iterations that means we need to specify starting position and ending
position
4. for Each
This is for only PHP are use
No comments:
Post a Comment