I’ve started to learn a new PHP notation I like better than the standard
<?php if (...)
{
// code here
} ?>
Instead, it uses
<?php if (...) :
// code here
endif; ?>
But I can’t figure out how to put an else on that. Can someone tell me how to do that?
The secondary notation for control structures goes
You should only be using this notation when templating HTML, as blocks and indentation make code much more readable and easier to follow. Some programmers will argue that the bracketless notation should never be used.