Posted by Snaggy on 10/18/07 15:32
I have a big multidimensional array and I need to access it at various
levels. The path is stored in a flat array:
I'm doing it like this:
$path = array("people", "men", "tall")
$my_array = <---- this is the big array!
foreach ($path as $x) {$p .= "[\"".$x."\"]" ;}
$str = "$part = $my_array".$p;
eval($str);
which works but is very ugly, I'd like to do something like
$temp = $my_array[$path];
but it doesn't work of course.
What can I do?
thanks
Navigation:
[Reply to this message]
|