Q: Return value from multi dimensional array with keys from another array Basically this is what I have
$foo = array(
    'bar' = array(
        'baz' = array(
            5
        )
    ),
);

And I have another array that holds the keys
$keys = array('bar','baz',0);

Is there a way I can get the value of the first array with the keys in the second array? I can probably try to write some recursive function that will end up getting the job done, but I was wondering if there was a neat way of doing this by using array functions ( not very good at those ) or something.. ?
Note: keys may not always be 3.

A: You can try something like this, it should work
$arr = $foo;
foreach($keys as $key)
{
   $arr = $arr[$key];
}

echo $arr; // 5


A: This could be what you are looking for. (not 100% sure if this would help)
you can see all the array functions on: http://php.net/manual/en/ref.array.php
  some neat ones that might do the trick:
   /function.array-fill-keys.php
   /function.array-fill.php
  /function.array-keys.php

