-2
Fatal error: Cannot redeclare class Plugin in E:\Xampp\htdocs\digi\plugin\plugin.php致命错误:不能重新声明类
我的根文件夹名称是:数码网络>插件> plugin.php
class Plugin
{
//code here
}
数码网络>包括>的header.php
include("./plugin/plugin.php");
$obj = new Plugin();
数码网络>指数。 php
include("plugin/plugin.php");
$obj = new Plugin();
<html>
<body>
include("include/header.php")
</body>
</html>
当我在中使用文件,然后我显示错误消息。我怎么解决这个问题。
注意:我需要在header.php
文件和index.php
文件中使用插件类。
如果你已经在你的header.php中包含这个文件,为什么你在index.php中再次包含它? – urfusion