associative arrays as variable variables ($$)
- From: "evanescent.lurker@xxxxxxxxx" <evanescent.lurker@xxxxxxxxx>
- Date: 21 Jul 2005 22:21:43 -0700
Hi all,
I've stumbled upon a problem with accessing associative arrays as
variable variables. I've spent a few hours trying to find a solution,
and I've searched the web a lot, but to no avail...
The problem is in the code:
$data[ 'Objects' ][ 'Spheres' ] = 'blah';
$dataVar = "\$data[ 'Objects' ][ 'Spheres' ]";
echo 'variable variable: ' . $$dataVar . '<br />';
echo 'variable name: ' . $data[ 'Objects' ][ 'Spheres' ] . '<br />';
I don't know why the 3rd line doesn't output what the 4th (last line)
does...
I've extracted the relevant code but I need to access that array as an
associative array. $data[23][3] would lost the meaning anyway :)
Thank you for your time,
-- Evanescent Lurker --
.
- Follow-Ups:
- Re: associative arrays as variable variables ($$)
- From: Janwillem Borleffs
- Re: associative arrays as variable variables ($$)
- Prev by Date: Re: Decent PHP Virtual Server Host
- Next by Date: Re: In the opinion of PHP, what is a character?
- Previous by thread: Re: navlink count - whats the best method
- Next by thread: Re: associative arrays as variable variables ($$)
- Index(es):