1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 正则匹配 只保留中文 英文 数字

正则匹配 只保留中文 英文 数字

时间:2019-12-22 03:32:58

相关推荐

正则匹配 只保留中文 英文 数字

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);$temp =join('',$result[0]);return $temp;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。