This is a discussion on require_once(), require(), include() within the PHP Programming forums, part of the Web Development category; What is difference between require_once(), require(), include()?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| What is difference between require_once(), require(), include()? |
|
#2
| |||
| |||
| Difference between require() and require_once(): require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error. Difference between require() and include() is that require() produces a FATAL ERROR if the file you want to include is not found, while include() only produces a WARNING. There is also include_once() which is the same as include(), but the difference between them is the same as the difference between require() and require_once(). |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| require_once | bordeauxkevin | PHP Programming | 0 | 12-29-2008 08:51 AM |
| What is the difference between require, include and include_once? | amansundar | PHP Programming | 3 | 11-28-2007 08:47 PM |
| Difference between#include< >and#include" " | vigneshgets | C and C++ Programming | 1 | 08-01-2007 10:41 PM |
| What is the difference between require_once(), require(), include()? | devarajan.v | PHP Programming | 2 | 07-30-2007 04:57 AM |
| PHP: include & require, what is different? | montyauto | PHP Programming | 2 | 06-30-2007 12:17 AM |
Our Partners |