Re: Variable variables

From: Date: Tue, 23 Dec 2003 19:04:30 +0000
Subject: Re: Variable variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173269@lists.php.net to get a copy of this message
Richard Baskett wrote:
Ok I am trying to create a variable from the value of a variable plus some extra text tagged on the end of it. So for example: $test = '_over'; $$CONFIG['island'].$test = 'testing';
${$CONFIG['island'].$test} = 'testing';
echo "hawaii = $hawaii_over";
Why not just use an array for all of this? Almost every time variable variables are used, it's a workaround to just using arrays. I don't know why these even exist, honestly... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#173269) next »