$value) { $answer = _array_search_dot($indexes, $value); if ($answer !== null) { return $answer; } } // Still here after searching all child nodes? return null; } } // If this is the last index, make sure to return it now, // and not try to recurse through things. if (empty($indexes)) { return $array[$currentIndex]; } // Do we need to recursively search this value? if (is_array($array[$currentIndex]) && $array[$currentIndex]) { return _array_search_dot($indexes, $array[$currentIndex]); } // Otherwise we've found our match! return $array[$currentIndex]; } }