: This article mainly introduces the differences among include, include_once, require, and require_once. if you are interested in PHP tutorials, refer. 1. include,
RequireIt contains a file at the called location.
2. include_once,RequireThe _ once function has the same function as include, but it first verifies whether the file is included. If it already exists, revoke de_once is not executed. Others are the same as include.
3,RequireThe main difference with include:,RequireWhen an error occurs, the script stops running. If an include error occurs, the script continues to run. B.RequireThe location of the file will be included inRequire. For exampleRequireIn the if statement where the calculation result is false, the specified file is still contained.
4. useRequire_ Once can solve the problem of file overwriting.RequireThe _ once function ensures that the file is only contained once. InRequire_ Once will be ignored when you attempt to include the same file later.
The above introduces the differences between include, include_once, require, and require_once, including The require content. I hope to help those who are interested in PHP tutorials.