- do-while loops are very similar to while loops, except the truth expression is checked at the end of each iteration instead of in the beginning.
- In PHP do-while is used to provide a control condition.
- In do-while the block of code executed once and then condition is evaluated. If the condition is true, the statement is repeated as long as the specified condition is true.
Learn PHP - PHP tutorial - Do While loop - PHP examples - PHP programs
php programming Syntax :
learn php Sample Code : a simple php program
php for beginners Code Explanation :
- $a =1 is a variable.
- In this example do statement specifies the variable $a which has 1 , that turns out to be true for the condition $a < 4 i.e.( 1<4 ). Therefore, the loop continues.
- while($a < 4) specifies the condition lesser than 4 which prints the echo statement “Loop will be stopped at a = 4”.
php tutorials Sample Output :
- Output -> “Loop will be stopped at a = 4“ specifies that the do while loop stopped at 4.
Related Searches to php do while loop
php while loop array
php while loop multiple conditions
php for loop array
php while array
while loop in php mysql
php for loop array length
coding in php
creating php website
custom php development
help with php
knowledge base php
learn php mysql online
open source php development