Re: return from the middle of a include file
| From: | Hellekin O. Wolf | Date: | Wed, 26 Jul 2000 23:06:38 +0000 |
| Subject: | Re: return from the middle of a include file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8425@lists.php.net to get a copy of this message | ||
Joao Prado Maia wrote:
>
> > Check out the include_once() function.
> >
> > http://snaps.php.net/manual/en/html/function.include-once.html
>
> That only works for PHP4, and even if it is the current version and
> everybody should be using it, thats not the reality. Anyway, my "way out"
> was designed to work on PHP3, since the user didn't say anything about
> which version he is running.
>
*** use define() and is_defined() at the beginning of your includes :
<?php
/*
** MyInclude.inc
*/
if (is_defined("MYINCLUDE")
return;
define("MYINCLUDE",1);
// Include code...
?>