php while endwhile

Syntax with "endwhile" used mostly in complex templates where easier to find "endwhile" than "}":

<?php
$i = 1;
while ($i <= 10):
	echo $i++;
endwhile; 
?>

Classic syntax:

<?php
$i = 1;
while ($i <= 10) {
	echo $i++;
}
?>
VN:F [1.9.17_1161]
Rating: +2 (from 2 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">