alternative if-then-else syntax

There's a small error in the PHP certification guide in the alternative if-then-else syntax code.

This alternative syntax goes like:
< ?php
if (true) :
echo 'it is true';
else :
echo 'so not true';
endif;
?>

In the example given in the cert guide, the ; after endif is missing, which will cause a parse error.

Bookmark and Share

Somewhat related posts

Comments are closed.