What is difference between Include File and Require File Statement?

include 'filename.php';
or
require 'filename.php';


Both statements are identical.
INCLUDE file and REQUIRE file statement enable to insert the content of one PHP file into another PHP file, like code , text..

The difference between them is that if errors occur REQUIRE file produce a fatal error and interrupts further display of content.

Although it is easier to use INCLUDE file, it is better to use a REQUIRE file in complex encoding to avoid errors that can destroy the integrity of the code resulting from the absence of a key file






Privacy Policy