Home  >  Article  >  Backend Development  >  PHP regular matching unicode encoding regular method_PHP tutorial

PHP regular matching unicode encoding regular method_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:54:35991browse

php tutorial regular match unicode encoding regular method. Because of the particularity of unicode encoding, general Chinese or English regular expressions cannot correctly obtain the content we want. Let’s take a look at a professional unicode regular expression Expression.

Look at the unicode encoding picture.

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632303.htmlTechArticlephp tutorial regular matching unicode encoding regular method, because of the particularity of unicode encoding, the general Chinese or English regular is If we can't get the content we want correctly, let's take a look...
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