Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function recursiveKeyExists($search = '', array $array = array())
- {
- foreach ($array as $key => $value) {
- if (is_array($value)) {
- $found = recursiveKeyExists($search, $value);
- if ($found) {
- return true;
- }
- }
- if ($key === $search) {
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement