I have several pages which use the include or require language constructs within PHP. Many of these lie within IF, ELSE statements.
I do realize that a page will not load at all if a require'd file is missing but the main purpose of including this way is to:
1) reduce code clutter on the page
2) not load the file unless a statement is met.
Does issuing an include or require statement load the file regardless (and thus eliminating the benefits I was trying to achieve by placing within the if/else statement?
Brief example:
<?php
$i = 1
if($i ==1) {
require_once('somefile.php');
} else {
require_once('otherfile.php');
}
?>
At page load, are both files checked AND loaded?