我已经在我的网站一个脚本instaled之后,我有一个错误:不能重新声明函数之前声明
Fatal error: Cannot redeclare ae_detect_ie() (previously declared in /home/xdesign/public_html/Powerful/config.php:24) in /home/xdesign/public_html/Powerful/config.php on line 29
这是该行:
function ae_detect_ie()
{
if (isset($_SERVER['HTTP_USER_AGENT']) &&
(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
return true;
else
return false;
}
我不明白我做错了!
相同的脚本的另一台主机工作。
检查[这](http://stackoverflow.com/questions/3620659/is-it-possible-to-覆盖函数在PHP中)和[这](http://stackoverflow.com/questions/1837184/is-it-possible-to-replace-a-function-in-php-such-as-mail并且做它一些)出来。 – BlitZ 2013-05-08 02:24:01
用'包裹! function_exists()'作为一个快速和肮脏的黑客? – alex 2013-05-08 02:27:25
或者使用'include_once()'来防止加载你的配置文件两次。 – mario 2013-05-08 02:28:55