You need to include a file in your PHP script, but you want to cause a fatal error if the file is not found. Which statement would you use and why?

  • include()
  • require()
  • include_once()
  • require_once()
To include a file in your PHP script and cause a fatal error if the file is not found, you would use the require() statement. If the file is not found, a fatal error will be generated, and the script execution will be halted, ensuring that the required file is available before continuing with the script.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *