RE: [PHP] Include Files - If already included
| From: | Pam Joseph | Date: | Fri, 06 Oct 2000 20:38:34 +0000 |
| Subject: | RE: [PHP] Include Files - If already included | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18973@lists.php.net to get a copy of this message | ||
Thanks guys, this list sure is time-saver.
pj
-----Original Message-----
From: James Moore [mailto:James@phpuk.org]
Sent: Friday, October 06, 2000 4:35 PM
To: pjoseph@gpc.peachnet.edu; Php-General@Lists. Php. Net
Subject: RE: [PHP] Include Files - If already included
> I know this was posted lately, but can't seem to find it in the archives.
> But, simply, what is the syntax to avoid including a file that has already
> been included by another file?
include_once()
or set $included[filename] = true;
at the top of a file and then do an if($included[filname] != true)
include(filename); for php < 4.0.1pl2 compatibility
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net