Re: Question about include_once and require_once
| From: | Al | Date: | Thu, 01 May 2003 13:59:45 +0000 |
| Subject: | Re: Question about include_once and require_once | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145959@lists.php.net to get a copy of this message | ||
FYI:
I just tried your link to
http://www.phparch.com/ and it didn't work.
John W. Holmes wrote:
The php lit is not clear, to me, exactly what is happening. Does the "once" refer to the session or to the page?Page. It has nothing to do with sessions. So if you have include_once('functions.php') in your code twice, the 'functions.php' code will only be parsed once with the first include_once() call.In other words: suppose I have a file with several functions andseveralpages on my site. My visitors can arrive at any page and thennavigatearound the site. If I use include_once () on all my php pages, can I rely on the session manager to maintain the functions for thevisitors? No. Not sure where you got this from, but sessions are a completely different topic.If I use just plain "include ()", does the php parser load up an additional copy for every time it's called?It will parse the include file each time include() is called. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/