Justtechjobs.com Find a programming school near you






Online Campus Both


php4-beta | 199912

[PHP4BETA] (FOLLOWUP) Global scope and functions From: D (drago <email protected>)
Date: 12/13/99

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

-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>