RE: [PHP] var vars in quotes - bug or feature?

From: Date: Wed, 06 Sep 2000 20:43:57 +0000
Subject: RE: [PHP] var vars in quotes - bug or feature?
Groups: php.general 
Request: Send a blank email to php-general+get-15576@lists.php.net to get a copy of this message
Hans Thanks for the suggestion, but from the first mail: >I thought some combination of {} might work if it was an ambiguity problem, but no luck. Since they are absolutely necessary, I've used braces in var vars such as ${$in[$i]}[] $${$vars[$j]}[$i] But once in quotes something changes in the PHP interprets them. med vänlig hälsning /Dana -----Original Message----- From: me@hansanderson.com [SMTP:me@hansanderson.com] Sent: Wednesday, September 06, 2000 8:25 PM To: Reed, Dana Cc: php-general@lists.php.net Subject: Re: [PHP] var vars in quotes - bug or feature? can't you use curly's to do it? Check the docs for a more elaborate treatment, but I think something like this works: echo "${$foo}[$j]"; I didn't try that and have never needed to use it and I've just upgraded to 4, which I think is the first to include this method. So, while I've not tried that, I think that works. Hans

« previous php.general (#15576) next »