Home >Backend Development >PHP Tutorial >php中用require、require_once、include、include_once
In PHP, to realize the mutual reference of two PHP files (calling functions in other files), we need to use the four methods require, require_once, include, and include_once. In terms of usage, the syntax of these four methods is the same. of. The following is an example usage of require (the other 3 reference methods are the same):
1. The difference between require_once, include and include_once:
require_once and
include_once
include and require:
include if an error occurs when referencing, the program will continue to execute, and a warning will be reported; if an error occurs in require, the program will terminate, and an error will be reported
Copyright statement: This article This is an original article by the blogger and may not be reproduced without the blogger's permission. The above introduces the use of require, require_once, include, and include_once in PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.