Hi. I want to be able to access a key in a multidimensional array at some
depth "n" without knowing before runtime what the keys are.

I thought this might be possible using variable variables. Here's some
sample code using variable variables and multidimensional arrays:
$y = 'a';
$z = 'b';
$t = 'c';
$x = array("a"=>array("b"=>array("c"=>TRUE)));

print_r($x{$y}{$z}{$t}); // Prints 1.

// I want to be able to concatenate the array indexes into one variable
variable. This would be done in a loop at runtime.
$u = ${$y.$z.$t};

print_r($x{$u}); // Doesn't work.

Any help would greatly be appreciated,


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to