<?php
function match_chinese($chars,$encoding='utf8'){
$pattern =($encoding=='utf8')?'/[\x{4e00}-\x{9fa5}a-zA-Z0-9]/u':'/[\x80-\xFF]/';
preg_match_all($pattern,$chars,$result);
return join('',$result[0]);
}
?>
<?php
$str = "feiniaomy.com?墨初。zblog,?#$%^&())*(&^A56934bch!s&h<s()%*中国航六🇨🇳宝哥_人#@𝓛𝓾𝓸𝓑𝓲𝓷";
echo match_chinese($str);
?>
标签: php