關(guān)于代碼分號(hào)結(jié)尾問(wèn)題
<?php
$p = "";//定義圓周率的兩種取值;
define("PI1",3.14);//定義變量PI變?yōu)槌A?.14;
define("PI2",3.142);
$height = "中";//定義值得精度;
if($height == "中"){$p = "PI1";}
else if($height == "低"){$p = "PI2";}
$r = 1;
$area = constant($p)*$r*$r;
echo $area
?>
if($height == "中"){$p = "PI1";} ? ??
else if($height == "低"){$p = "PI2";}
????為什么分號(hào)要再中括號(hào)里面打。而不是外面,不是以分號(hào)結(jié)尾嗎
2017-07-01
<?php
echo "花括號(hào)表示:一個(gè)代碼語(yǔ)言的集合。所以,分號(hào)一定是在括號(hào)內(nèi)部"
?>