In PHP, a require
statement will include and evaluate the specified file.
require 'path/to/some/file.php';
A require_once
statement does the same but will check if the file has already been included and, if so, not include it again.
require_once 'path/to/some/file.php';
The benefit of using require_once
is very clear but what's the advantage of using a require
statement instead of require_once
?
Ref: