这是“connect.php”代码:
<?php
if(!require_once(explode('root',$_SERVER['DOCUMENT_ROOT'])[0].'root/core/function.php')) die('file not found');
在我转移到新服务器之前,代码运行良好
现在无论我尝试多少次仍然显示错误:
[09-Jan-2013 17:05:39] PHP Parse error: syntax error, unexpected '[' in /home/wwwroot/root/core/connect.php on line 2
[09-Jan-2013 17:10:10] PHP Parse error: syntax error, unexpected '[' in /home/wwwroot/root/core/connect.php on line 2
我试图打开一个新的 php 文件来测试它:
<?php
print_r(explode('root',$_SERVER['DOCUMENT_ROOT']));
?>
结果应该有效!
Array (
[0] => /home/public_html/
[1] => /core/
)
搞什么鬼!?