RE: [PHP] global

From: Date: Wed, 09 Aug 2000 17:21:06 +0000
Subject: RE: [PHP] global
Groups: php.general 
Request: Send a blank email to php-general+get-10963@lists.php.net to get a copy of this message
An array would be better, but if that's not an option, do this: foreach ($GLOBALS as $key => $value) { if (ereg("^f[[:digit:]]+$", $key)) { global $$key; } } --Bruce Bruce Christensen Intel Corporation brucex.r.christensen@intel.com -----Original Message----- From: Dustin Leggans [mailto:dustinl.rm@yahoo.com] Sent: Wednesday, August 09, 2000 9:07 AM To: php-general@lists.php.net Subject: [PHP] global Hello... If I have a bunch of variables... $f1, $f2, $f3, $f4.. etc.. that are all named $f - then a number - and I want to define all the "$f" variables as global within a function, is there an easy way to do this without naming every variable? Thanks, Dustin Leggans __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#10963) next »