我想使這個下面的VBScript到PHP:VBScript來PHP
Dim RootDomain : RootDomain = Request.ServerVariables("server_name")
Dim paryDomain : paryDomain = Split(RootDomain,".")
IF uBound(paryDomain) = 1 THEN
RootDomain = paryDomain(0) & "." & paryDomain(1)
ELSEIF uBound(paryDomain) = 2 THEN
RootDomain = paryDomain(1) & "." & paryDomain(2)
END IF
IF RootDomain = "storeboard.com" THEN
G_SYSTEMID = 1
ELSEIF RootDomain = "dcwn.org" THEN
G_SYSTEMID = 2
END IF
我做了以下內容:
$Domain = $_SERVER['SERVER_NAME'];
$paryDomain = explode(".",$Domain);
$Array = count($paryDomain)
if ($Array == "1")
{
$RootDomain = $paryDomain[0].'.'.$paryDomain[1];
}
elseif ($Array == "2")
{
$RootDomain = $paryDomain[1].'.'.$paryDomain[2];
}
echo $RootDomain
我是用PHP初學者,我收到以下錯誤:
PHP Parse error: syntax error, unexpected T_IF in C:\inetpub\mydomain.com\testing\test_sql_server.php on line 53
53號線:
if ($Array == "1")
我在做什麼錯?任何幫助將不勝感激。
缺少分號...... – deceze