Re: default extension for includes?

From: Date: Tue, 23 Nov 2004 02:08:13 +0000
Subject: Re: default extension for includes?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-202711@lists.php.net to get a copy of this message
On 23/11/2004, at 12:44 PM, Jake Press wrote:
Justin, 'Use the force luke' - or perhaps just write yourself a function to do this :)
Sadly, included files inside functions don't inherit the global namespace, so you have to do something ridiculous like extract($GLOBALS) inside the function: function includer($thing) { extract($GLOBALS); include($thing.".inc"); } The extract isn't too expensive, but it's definitely something I'd like to avoid if possible. Justin

« previous php.general (#202711) next »