Include and require
| From: | Dave Goodchild | Date: | Mon, 14 Aug 2006 21:20:47 +0000 |
| Subject: | Include and require | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-240655@lists.php.net to get a copy of this message | ||
Hi all - I have several require_once statements in my web app to load in
small function libraries. A common one bundles a variety of functions to
handle date math and map month numbers to month names. I originally defined
an array in that file plus a bunch of functions but when I loaded the page,
the array variable, referenced further down the page, was NULL. I wrapped a
function def around the array and returned it and all was fine.
I may be suffering from mild hallucinations, but can you not define
variables in a required file? It is not a scope issue as the array variable
is referenced in the web page, not in any function.
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk