Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

difference between include and require....
(1 viewing) (1) Guest
All your queries regarding
PHP Installation,
Binding Apache-PHP-MySQL,
and tonnes more... will be solved in this forum
  • Page:
  • 1
TOPIC:

difference between include and require....

difference between include and require.... 1 year, 10 months ago #46

  • shama
  • OFFLINE
  • Senior Boarder
  • Posts: 63
  • Karma: 0
Hi

I am new to PHP.

I what to know the difference is between include and require?

Re:difference between include and require.... 1 year, 10 months ago #60

  • sabastian
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
include(), require() will always read in the target file, even if the line it's on never executes.

If you want to conditionally include a file, use include().

The conditional statement won't affect the require().

However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed.

If the file is not found by require(), it will cause a fatal error and halt the execution of the script.

If the file is not found by include(), a warning will be issued, but execution will continue.
  • Page:
  • 1
Time to create page: 2.93 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download