public static function array_match_key($map, $key)
{
$replace = str_replace(array('(', ')', '.'), array('\\(', '\\)', '\\.'), $key);
$pattern = "/{$replace}*/";
foreach ($map as $k => $v) {
preg_match($pattern, $k, $matches);
if (count($matches) > 0) {
return true;
}
}
return false;
}