RE: [PHP] Question about include_once and require_once
| From: | Gavin Nouwens | Date: | Thu, 01 May 2003 14:02:40 +0000 |
| Subject: | RE: [PHP] Question about include_once and require_once | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145960@lists.php.net to get a copy of this message | ||
Works fine from .au
-gav.
| -----Original Message-----
| From: Al [mailto:news@ridersite.org]
| Sent: Friday, 2 May 2003 12:00 AM
| To: php-general@lists.php.net
| Subject: Re: [PHP] Question about include_once and require_once
|
|
| 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 and
| >>
| >>
| >several
| >
| >
| >>pages on my site. My visitors can arrive at any page and then
| >>
| >>
| >navigate
| >
| >
| >>around the site. If I use include_once () on all my php pages, can I
| >>rely on the session manager to maintain the functions for the
| >>
| >>
| >visitors?
| >
| >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/
| >
| >
| >
| >
|