(FOLLOWUP) Global scope and functions
| From: | D | Date: | Tue, 14 Dec 1999 02:38:07 +0000 |
| Subject: | (FOLLOWUP) Global scope and functions | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-7889@lists.php.net to get a copy of this message | ||
I came up with my own work around...hopefully there is a better solution,
but this works for now.
The isset() causes the local variable override of course.
function myinclude($f) {
reset($GLOBALS);
while (list($key, $val) = each($GLOBALS)) {
if (!isset(${$key})) {
global ${$key};
}
}
$df=basename($f);
echo "\r\n\r\n<!-- BEGIN: $df -->\r\n\r\n";
include($f);
echo "\r\n\r\n<!-- END: $df -->\r\n\r\n";
}
-d
--
(void *)0