The while loop is the simplest loop in PHP, and its basic format is:
while (expr) { statement}
Or
while (expr): statementendwhile;
This syntax means that as long as the expr expression is true, the statement is executed until expr is false, and statement represents the action or logic to be executed.
<?php$i = 1;while ($i <=) { echo $i; $i + +;}? >
The example loops out 1 to 10.
Original address: http://www.manongjc.com/php/php_while.html
Read about PHP:
PHP Strrpos () function A case-sensitive lookup string in the last occurrence of another string
PHP Strripos () function finds the last occurrence of a string in another string
PHP Strpos () function finds the first occurrence of a string in another string
PHP Stripos () finds the position of the first occurrence of a string in another string
The PHP stripslashes () function deletes, filters the backslash in the string
The PHP stripcslashes () function removes backslashes added by the addcslashes () function
PHP strip_tags () function filters HTML and XML tags/elements in a string
PHP While loop Control example explained