Php/keyword require once

来自菜鸟教程
机器人讨论 | 贡献2020年11月12日 (四) 08:45的版本 (机器人:添加分类Php基础教程
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至:导航、​搜索

PHP require_once关键字

Keywords PHP关键字

Use require_once 在页面上添加页脚:

  <!DOCTYPE html>
<html>
<body>

<h1>Welcome to my home 
  page!</h1>
<p>Some text.</p>
<p>Some more text.</p>
<?php 
  require_once 
  'footer.php';?>

</body>
</html>

定义和用法

The require_once 关键字用于嵌入另一个文件中的PHP代码。如果找不到该文件,则会引发致命错误,并且程序将停止。如果以前已包含该文件,则此语句将不再包含它。

相关页面

The require 关键词

The include 关键词

The include_once 关键词

阅读有关在我们的文件中包含文件的更多信息 PHP包含文件教程

.

Keywords PHP关键字