require() and require_once()
require_once(): The same file is only called once
Usually placed at the front of the PHP program. Before the PHP program is executed, it will first read in the file specified by require
. It is fatal if an error occurs.
include() and include_once()
include_once()
: The same file is only called once
and can be placed anywhere in the PHP program. When the PHP program is executed, it will first read in the
include specified Imported files will be prompted if an error occurs.