6 ms·
Because a single colon is used in an alternative if/else/foreach etc syntax: <?php if($var == true): ?> Hello world <?php else: ?> Cake is a lie
by vulpes 17y ago
Because a single colon is used in an alternative if/else/foreach etc syntax:
<?php if($var == true): ?>
Hello world
<?php else: ?>
Cake is a lie
<?php endif; ?>
Edit: syntax
- shaunxcode 17y agostun taken - I seriously had forgotten about that.
- kenver 17y agoIt's also used in the ternary operator x = condition ? if_true : if_false;