Home >Backend Development >PHP Tutorial > 正则解决方法

正则解决方法

WBOY
WBOYOriginal
2016-06-13 13:06:03783browse

正则
php 截取中文 $str='{,watch,:表壳、套装}'; 结果为:表壳、套装 求一正则??

------解决方案--------------------

PHP code
preg_match_all('/[\x{4e00}-\x{9fa5}]+/u',$str,$m);
print_r($m[0]); <div class="clear">
                 
              
              
        
            </div>
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