PHP 8
Beginner
Basics
· 1 min read
while loop
How do I loop while a condition is true?
while.
Example
<?php
$i = 1;
while ($i <= 3) {
echo $i;
$i++;
}
Line-by-Line Walkthrough
Ensure the condition eventually becomes false.