jk11uk Posted February 7, 2008 Share Posted February 7, 2008 whats the difference between require and include? Quote Link to comment Share on other sites More sharing options...
aschk Posted February 7, 2008 Share Posted February 7, 2008 The difference is in warning message and behaviour... include will output a warning only and won't stop the scripting process. require will through a higher level error (cant remember what exactly) and will STOP all scripting. p.s. this is from memory and i don't guarantee it's the case. Quote Link to comment Share on other sites More sharing options...
nethnet Posted February 7, 2008 Share Posted February 7, 2008 They function essentially the same way, the difference betwwen them being how they return errors. If the included file isn't found or is not able to be included, PHP will throw a warning and continue running the rest of the script. If the required file isn't found or is not able to be included, PHP will throw a fatal error and stop executing the script. Information in the manual: require() include() Also look at the following: require_once() include_once() Theo Quote Link to comment Share on other sites More sharing options...
aschk Posted February 7, 2008 Share Posted February 7, 2008 i'm hearing an echo in here here here.... Quote Link to comment Share on other sites More sharing options...
nethnet Posted February 7, 2008 Share Posted February 7, 2008 That's what happens when two people reply at the same time time time... Quote Link to comment Share on other sites More sharing options...
pdkv2 Posted February 7, 2008 Share Posted February 7, 2008 http://in2.php.net/manual/en/function.require.php http://in2.php.net/manual/en/function.include.php ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.