PHP endwhile Keyword
Example
Print $i as long as $i is less than 6:
<?php
$i = 1;
while ($i < 6):
echo $i;
$i++;
endwhile;
?>
Try it Yourself »
Definition and Usage
The endwhile keyword is used to mark the end of a while loop which was started with
the while(...): syntax.
Related Pages
The while keyword.
Read more about while loops in our PHP while Loop Tutorial.
❮ PHP Keywords