Include, include_once, require, require_once differences 1. include, require contains a file at the called location. 2. the functions of include_once and require_once are the same as those of include. However, they first verify whether the file is included. If it already exists, revoke de_once is not executed. Others are the same as include. 3. differences between r include, include_once, require, and require_once
1. include and require include a file at the called location.
2. the functions of include_once and require_once are the same as those of include. However, they first verify whether the file is included. If it already exists, revoke de_once is not executed. Others are the same as include.
3. the main difference between require and include is that when a and require errors occur, the script will stop running, and when the include errors occur, the script will continue to be executed. B. regardless of the location of require, the file will be included in the script where require appears. For example, even if require is placed in an if statement whose calculation result is false, it still contains the specified file.
4. use require_once to solve the problem of file overwriting. The require_once function ensures that the file is only contained once. If you encounter require_once and try to include the same file later, it will be ignored.
-
Small Shard on the first floor
-
Learned