Re: how include works?
| From: | Adam Zey | Date: | Tue, 23 May 2006 23:23:47 +0000 |
| Subject: | Re: how include works? | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-236791@lists.php.net to get a copy of this message | ||
Mindaugas L wrote:
Hi can anybody explain how require works, and what's the difference between _once and regular? What's going on when php file is processed? In manual is written just, that it's readed once if include_once. What does to mean "readed"? Thank YouThe difference between include and require is that if include() can't find a file, it produces a warning, and the script continues. If require() can't find a file, the script dies with a fatal error. The difference between include()/require() and include_once()/require_once() is that if you do, say, require_once() twice, it ignores the second one. This is useful if your script might include the same file in different places (perhaps your main script includes two other scripts which both themselves include "functions.php") Regards, Adam Zey.