I want to access a specific array\'s property by using a separate array as the path. The problem is the property in question may be at any depth. Here\'s an example...
It's not the greatest code, but should work:
function getValue($pathArray, $data) { $p = $data; foreach ($pathArray as $i) { $p = $p[$i]; } return $p; }