What is the difference between include and require in PHP?

Include and Require in PHP Program -:

We can include the content of a file into another file using require and include statement.

Include
  • It will show the warning if it fails to find the file and execute the remaining scripts.
  • Syntax: include ‘filename’;
Require
  • It will show the Fatal error if it fails to find the file and stops the execution.
  • Syntax: require ‘filename’;

Leave A Comment?

five × 2 =