Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function array_search_path_recursive(array $haystack, $needle) {
- foreach ($haystack as $key => $value) {
- if (is_array($value)) {
- $result = array_search_path_recursive($value, $needle);
- if ($result !== false) {
- return $key . '->' . $result;
- }
- } elseif ($value === $needle) {
- return $key;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement