Home >php教程 >php手册 >PHP 正则匹配unicode 编码正则方法

PHP 正则匹配unicode 编码正则方法

WBOY
WBOYOriginal
2016-06-13 09:55:101622browse

php教程 正则匹配unicode 编码正则方法,因为unicode编码的特殊性,所以一般的中文或英文正则是不能正确取到我们想要的内容的,下面来看一款专业的unicode正则表达式吧。

看个unicode编码图。

$words = "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrsruvwxyz!@#$%^&*()_+-=[],./{}|?'"你好啊我们";
$otherstr=preg_replace("//[x{0080}-x{00ff}]+/iu"," ",$words);
echo 'otherstr:',$otherstr;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn