[thelist] Alternative Control Structure Syntax in PHP

Sarah Adams mrsanders at designshift.com
Tue Aug 29 12:41:30 CDT 2006


> <?php if ($a == 5): ?>
> A is equal to 5
> <?php endif; ?>

> I personally like it in cases as above where the block extends beyond
> the ending ?> tag.

Personally, I would think this syntax is just as easy to read/type, but
maybe I'm missing something:

<?php if ($a == 5) { ?>
A is equal to 5
<?php } ?>

-- 
sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca



More information about the thelist mailing list