\x80-\xff:匹配用GBK (GB2312/GB18030)编码的所有汉字和全角标点符号
0 1 2 3 4 |
<?php $str = '138123械45的67在8,.(!)<>《》(!)。,'; $a = preg_replace('/([\x80-\xff]*)/i','',$str); echo $a; // 输出 13812345678,.(!)<> |
\x80-\xff:匹配用GBK (GB2312/GB18030)编码的所有汉字和全角标点符号
0 1 2 3 4 |
<?php $str = '138123械45的67在8,.(!)<>《》(!)。,'; $a = preg_replace('/([\x80-\xff]*)/i','',$str); echo $a; // 输出 13812345678,.(!)<> |