Loops are used in programming to do the same tasks many times, while a condition is true...
That means, same script will be executed and repeated, until that condition becomes false.
The loop statements used in php are:
while
do ... while
for
foreach
while and do ... while are similar, the only difference is that, the first one will execute the script if and as long as the condition is true, but the second one, will execute the script, then repeat it as long as the condition is true. In brief, when condition is false while will not do the tasks and exit, but do ... while will do them and exit.
For is to repeat tasks a specific number of times, like you want to execute a script 10 times ....
Foreach to repeat tasks for each element in an array.
Next posts will show how to use these statements.
If you have any questions, post them.
2 comments:
- Diablo 3 Gold said...
-
i enjoy your own composing ,their thus understandable ,pleasant and simple to read .. thx . Buy RS Gold Cheap Diablo III Gold
- February 19, 2013 at 12:19 AM
- Interior Decorators Edison said...
-
Hi nicee reading your post
- October 31, 2022 at 8:45 PM
Subscribe to:
Post Comments (Atom)
Search With Google
Categories
- 1-General (3)
- 2-Getting started (4)
- 3-Strings (10)
- 4-Server config (1)
- 5-Best scripts (7)
- email (4)
- files (6)
- Forms (3)
- If statements (3)
- Loop statements (2)
- Mysql (2)
- Server variables (3)
- Sessions (1)
- Tutorials-planet.com (1)
- web hosting (1)
- You need a programmer ? (1)