← CodePrimer
PHP Beginner Basics

while loop

How do I loop while a condition is true?

while.

Sample
<?php
$i = 1;
while ($i <= 3) {
  echo $i;
  $i++;
}

Notes

Ensure the condition eventually becomes false.

Keywords: while · loop

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share