我看到了下面的代碼片段:if和else語句中「:」的用法是什麼?
<?php
if(!empty($_POST)): // case I: what is the usage of the :
if(isset($_POST['num']) && $_POST['num'] != ''):
$num = (int)$_POST['num'];
....
if($rows == 0):
echo 'No';
else: // case II: what is usage of :
echo $rows.'Yes';
endif;
我想知道的是什麼用法「:」在PHP代碼。
我開了這個問題,認爲它是關於某種倒退三元運算 – 2010-07-16 20:12:18