This is a discussion on PHP: include & require, what is different? within the PHP Programming forums, part of the Web Development category; Hope this is not stupid question. I read the manual frequently, still could not understand what different between include() and ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hope this is not stupid question. I read the manual frequently, still could not understand what different between include() and require(), it makes no different to me. Could you show me in an example script to show the different result between those two? Thanks. |
| Sponsored Links |
| |||
| Hope this is not stupid question. I read the manual frequently, still could not understand what different between include() and require(), it makes no different to me. Could you show me in an example script to show the different result between those two? Thanks. |
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/php-programming/1477-php-include-require-what-different.html | |||
| Posted By | For | Type | Date |
| PHP: include & require, what is different? - geek/talk | This thread | Refback | 08-08-2007 03:02 PM |
| PHP: include & require, what is different? - geek/talk | This thread | Refback | 08-05-2007 05:19 PM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is the difference between require, include and include_once? | amansundar | PHP Programming | 3 | 11-28-2007 09:47 PM |
| Difference between#include< >and#include" " | vigneshgets | C and C++ Programming | 1 | 08-01-2007 11:41 PM |
| Explain the difference between use and require. | vadivelanvaidyanathan | Perl | 1 | 07-30-2007 07:39 AM |
| What is the difference between require_once(), require(), include()? | devarajan.v | PHP Programming | 2 | 07-30-2007 05:57 AM |
| require_once(), require(), include() | sivakumar | PHP Programming | 1 | 07-16-2007 07:39 AM |