differences between require and include (1 Viewer)

preetisoft2

Registered User.
Local time
Yesterday, 23:04
Joined
May 6, 2013
Messages
14
What are the differences between require and include, include_once and require_once?
 

GSSDevelopment

PHP Guru
Local time
Today, 02:04
Joined
Dec 31, 2012
Messages
58
Sorry for the late reply

Include will attempt to include a file you specify. If it doesn't exist, the script will continue, giving a warning.

Require will do the same thing, but if the file doesn't exist, it will halt the script.

The _once modifiers mean that it will attempt to include the file only if it hasn't already been included. The difference between require_once and include_once is the same as noted above.

Cheers
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom