我想让文件加载一次, 不想让其重复加载
<?php
requrie("jc1.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
我的个人主页
</body>
</html>
<?php
include("jc1.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
我的个人主页
</body>
</html>
有什么办法吗?require 引入的文件中不能包含条件语句吗?
还是需要引入URL文件?
**
**
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
是
require
不是requrie
估计是你的jc1.php里的代码有问题,
require一个文件存在错误的话,那么程序就会中断执行了,并显示致命错误
include一个文件存在错误的话,那么程序不会中端,而是继续执行,并显示一个警告错误。
refer:http://www.jb51.net/article/22467.htm