本文概述
它与包含类似, 但仅包含一次外部文件。首先, 它将检查指定的文件是否已经包括在内。如果不包括该文件, 则仅包括一个外部文件。
例子1
另存为page1.php

另存为page2.php

输出

例子2
更改page1.php中的语句

输出

在example2中require_once无法正常工作。
来源:
https://www.srcmini02.com/29219.html
它与包含类似, 但仅包含一次外部文件。首先, 它将检查指定的文件是否已经包括在内。如果不包括该文件, 则仅包括一个外部文件。
另存为page1.php
另存为page2.php
输出
更改page1.php中的语句
输出
在example2中require_once无法正常工作。
来源:
https://www.srcmini02.com/29219.html