eshban
07-12-2005, 01:29 PM
Can anyone explain, that what is the difference between "Include" and "require_once"
plz require
Eshban
plz require
Eshban
|
||||
difference between include and Reuqire_onceeshban 07-12-2005, 01:29 PM Can anyone explain, that what is the difference between "Include" and "require_once" plz require Eshban Sayonara 07-12-2005, 01:35 PM The difference is in the level of error that will be returned if the file cannot be included/required. Like include() and require(), include_once() returns a warning and require_once() returns a fatal error. http://uk.php.net/manual/en/function.include.php missing-score 07-12-2005, 03:00 PM Also, I believe that with require_once, PHP will not require the same file twice (which will often lead to errors) eg, the code: require('functions.php'); require('functions.php'); will cause errors, becuase the first require loads the functions, and then the second file trys to re-declare them. using require_once in place of require will stop this from happening. Like Sayonara said, there are different levels of warning for include & include_once, and require & require_once Fou-Lu 07-12-2005, 03:01 PM As with the *_once section for the functions, the difference this creates is that it will not include code already presented to it. So if you have a value that you would like to allow overwriting by another variable within an include, use include instead of include_once. |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum