Q . Difference between include and require?

Mike Tyson. asked, Nov 25 ' 2014
include('filename');

or

require('filename');

 

  • PHP
  • include
  • require

1 Answers

Require will produce a fatal error (E_COMPILE_ERROR) and stop the script if file doesn't exist.

Include will only produce a warning (E_WARNING) and the script will continue even if file doesn't exist.

Leave a Ansewer