for loop:
while loop:
for($start=0; $start < 11; $start++) {
echo "for loop test";//text will be printed 11 times
}while loop:
while (condition) {
//statement
}
do while loop:
do
statement
while (condition)
The difference is that your statement gets executed at least once. In a normal while loop, the condition could be met before your statement gets executed.
Comments
Post a Comment