function get_multi($arr, $str) { foreach (explode('.', $str) as $key) { if (!array_key_exists($key, $arr)) { return NULL; } $arr = $arr[$key]; } return $arr; }