Search code examples
phprequire-once

Is PHP's require_once() what I need if I want my site to load if AND ONLY IF the menu loads correctly?


I'm kind of confused.

I would put all the HTML for the menu in a .php file and have the engine require it right?


Solution

  • According to the manual, the require() function will produce a fatal error if it cannot find the required file. So, if you require() the menu and the menu file is not present, you page will not show.
    But if the menu file is found and contains errors, the page will show them.