Free Web Hosting with No Ads
Support Forums
Free Web Hosting Signup
Free Forum Hosting
FREE HOSTING SERVICES MEMBERS LOGIN MESSAGE BOARD FAQ
Free Web Hosting
Free Hosting
Sign Up Now
Free PHPBB
Free File Host
Free Image Host
Free Blog
Webmaster Tools
Members Login
Paid Hosting
Buy Domains
Resources
FAQ
Link Directory
Terms of Use
Contact Us
Tell a Friend



What's the difference between include and require?

Unlike 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.

Typically, this won't make a difference to you unless you write things like:

<?php
if (1 == $var) {
include "include.inc.php";
}
?>

See also require_once at http://www.php.net/require_once, which only will read the file one time, no matter how many times you include it. This solves some include issues, if you have lots of includes.


Make Money Easy
© 2005-2010 NetFreeHost.com All Rights Reserved.