alternative if-then-else syntax

March 11th, 2005. Tagged: PHP certification

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.

Tell your friends about this post: Facebook, Twitter, Google+

Sorry, comments disabled and hidden due to excessive spam. Working on restoring the existing comments...

Meanwhile, hit me up on twitter @stoyanstefanov