Colon operator (:), mainly used in php and html inline coding.
Using this operator, you can avoid using curly braces. This operator reduces the complexity of inline coding. You can use this operator (:) with if, while, for, foreach, etc.
Without operator (:)
<body>
<?php if(true){ ?>
<span>This is just test</span>
<?php } ?>
</body>
With operator (:)
<body>
<?php if(true): ?>
<span>This is just test</span>
<?php endif; ?>
</body>
source
share