2013-10-14 94 views
-3

我得到這個錯誤在PHP中。誰能幫助!它說

意外 '$ ARR'(T_VARIABLE)

。什麼是T_變量?

<?php $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; else echo "Have a nice day!"; 
    print "\nday is $d"; 

    $array = array(1, 2, 3, 4, 5); foreach($array as $value) { echo "Value is $value <br />"; } 

    print "\n associative arrays" 


    $arr = array( 
        "key1" => value1, 
        "key2"=> value2, 
        "key3"=> value3 
        ); 

     echo "printing out"; 

     //foreach($arr as $value) 
     //echo "$value "; 
    ?> 
+2

'E_SEMICOLON_MISSING_IN_LINE_BEFORE' – bwoebi

+0

使用IDE來避免這樣的一個錯字錯誤。 (eclipse,netbeans,phpstorm是3百萬) –

回答

2

你忘了分號。

print "..."; 
+0

T_variable是什麼? – sjsupersumit

+0

它是變量的解析器令牌。 –

+0

明白了:) – sjsupersumit

0

變線:

print "\n associative arrays" 

到:

print "\n associative arrays"; 
0

添加分號後

print "\n associative arrays"; 
相關問題