-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Labels
Description
Description
The following code:
<?php
// 替换字符串内的逗号、中文逗号、分号、顿号、空格等为英文逗号,会发生部分中文字符乱码
$str = "我发送到发顺丰,,阿斯蒂芬去玩了,,发生、的吴 青峰";
$newStr = preg_replace('/[,,;、\s]+/', ',', $str);
echo $newStr;
Resulted in this output:
我发�,到发顺丰,阿斯蒂芬去玩了,发生,的吴,青峰
But I expected this output instead:
我发送到发顺丰,阿斯蒂芬去玩了,发生,的吴,青峰
PHP Version
PHP 8.3.3
Operating System
Mac