RE: [PHP] Function redefine ?
| From: | Moritz Petersen | Date: | Sun, 07 Jan 2001 18:57:12 +0000 |
| Subject: | RE: [PHP] Function redefine ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33105@lists.php.net to get a copy of this message | ||
Unfortuanteley, you are using PHP 3.
Since PHP 4.0.1pl2 there is a function called "include_once()", which lets
you include a file only once, even if there are multiple calls of
include_once().
I am using include_once() to include every file I need. I don't have to care
about multiple inclusions or refining errors.
If you have a chance to use PHP 4, you should do it.
Hope it helps,
Mo.
> I have a file called menu.php3 - this file has one include file -
> file1.inc.
> Now I have another inlcude file that need to be used - file2.inc.
>
> If I include the file in menu.php3 then file1.inc does not seem to be able
> to access the functions in it.
>
> I don't want to include the file in menu.php3 and file1.inc because then I
> get a redefining error.
>
> Is there an alternative to make the functions in one include file
> accessible
> from another include file?
>
> Thanks,
> Abe
>
>
> --
> 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
>