<?php
$str = 'hello World!@#$%^&*()你好012345';
print_r(preg_replace("/[^a-zA-Z0-9\x{4e00}-\x{9fa5}]+/u", ' ', $str).PHP_EOL);
print_r(preg_replace("/[^a-zA-Z0-9\x{4e00}-\x{9fa5}]/u", ' ', $str).PHP_EOL);
php正则笔记-匹配字母、数字、中文
最新推荐文章于 2022-11-08 14:49:59 发布