public function hasKey(string $needle, array $haystack) : bool
    {
        foreach ($haystack as $key => $value) {
            if ($key === $needle) {
                return true;
            }

            if (is_array($value)) {
                if ($x = $this->hasKey($needle, $value)) {
                    return $x;
                }
            }
        }

        return false;
    }
public function hasKey(string $needle, array $haystack) : bool
    {
        foreach ($haystack as $key => $value) {
            if ($key === $needle) {
                return true;
            }

            if (is_array($value)) {
                if ($x = $this->hasKey($needle, $value)) {
                    return $x;
                }
            }
        }

        return false;
    }
public function hasKey ( string $ needle , array $ haystack ) : bool { foreach ( $ haystack as $ key => $ value ) { if ( $ key === $ needle ) { return true ; } if ( is_array ( $ value ) ) { if ( $ x = $ this -> hasKey ( $ needle , $ value ) ) { return $ x ; } } } return false ; }
Check if array has key recursivly
@param  string  $needle   Array key to find
@param  array   $haystack Array to search
@return boolean
Check if array has key recursivly