Syntax with "endwhile" used mostly in complex templates where easier to find "endwhile" than "}":
<?php
$i = 1;
while ($i <= 10):
echo $i++;
endwhile;
?> |
<?php
$i = 1;
while ($i <= 10):
echo $i++;
endwhile;
?>
Classic syntax:
<?php
$i = 1;
while ($i <= 10) {
echo $i++;
}
?> |
<?php
$i = 1;
while ($i <= 10) {
echo $i++;
}
?>