我有一個問題,這個字符串解析錯誤:語法錯誤意外T_CONSTANT_ENCAPSED_STRING
'Require.www' => false
此代碼給我的錯誤:
>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\KERNEL-DOCMS\Server.Config.php on line 5
我該如何解決這個問題?它位於在線遊戲的serverconfig中。
完整的代碼是:
## URL
$Config['URL'] =
'Default'
'Require.www' => false, // www.example.com
'SSL.enabled' => true, // https://
'Server' => '***', // public server
'Lang' => 'en_US' // GLOBAL.
,
'Other' =>
//'example.com' => ['Require.www' => false, 'SSL.enabled' => false, 'Lang' => 'es_ES', 'MySQL' => ['host' => '127.0.0.1','user' => 'root','pass' => '','dbname' => 'cmsdb']]
,
'devPrivateServer' => 'localhost' // private developer server
;
## SQL Server Data
$Config['MySQL'] =
'host' => '127.0.0.1',
'user' => '***',
'pass' => '***',
'dbname' => 'do'
;
// Do not tuch the code below this text if yuo do not know what yuo're doing
define("DB_DSN", "mysql:host".$Config['MySQL'] ['host'].";dbname".$Config['MySQL']['dbname']."");//this constant will
define ("DB_USERNAME", $Config['MySQL']["user"]); //username of database
define ("DB_PASSWORD", $Config['MySQL']["pass"]); //username of database
define ("CLS_PATH", "class"); //the class path of our project
你沒有顯示相關的代碼。提供完整的聲明。 – mithunsatheesh 2014-10-04 12:50:50
以擴展最後一條評論,像這樣的錯誤可以顯示實際錯誤後的行號,因爲上一行末尾的缺失符號可能導致下一行成爲無效語法。 – JimL 2014-10-04 12:52:36