What should I use in the following statement? Include or required.
if(a ==b){
require 'requiredfile.php';
} else {
require 'requiredfile_2.php'
}
If in a function, I know that one, either include or require, only includes the file when called, the other one will include the file regardless. Am I correct?
The difference between
includeandrequireis that include will only emit a warning when the file is not found, and require will terminate with a fatal error.If you are loading vital program parts, you probably want to go with
require.Manual