这个if语句的含义[if(condition):something; 万一;]

Cod*_*oet 3 php joomla

joomla今天一直在阅读一些代码,我经常遇到如下语句:

<?php if ( intval($this->item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?>
            <tr>
                <td colspan="2"  class="modifydate"><?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?> </td>
            </tr>
<?php endif; ?> 
Run Code Online (Sandbox Code Playgroud)

我读它的方式,似乎转换为以下语法:

if (condition) :
    // do something here
endif;
Run Code Online (Sandbox Code Playgroud)

我不熟悉这种语法(:if语句之后).谁能指引我到正确的地方?

Zbi*_*iew 5

检查控制结构的替代语法:

PHP为其某些控制结构提供了另一种语法; 即,if,while,for,foreach和switch.在每种情况下,替代语法的基本形式是将开括号分别更改为冒号(:)和结束括号为endif;,endwhile;,endfor;,endforeach;或endswitch;.