更新时间:2022-06-14 23:11:30
preg_replace('/(?<=\b[a-z]) /i', ' ', $s);
此处的正则表达式执行正向后视确保空格前面是单个字母和单词边界.
The regular expression here performs a positive lookbehind which ensures that the space is preceded by a single letter and a word boundary.
PHP 正则表达式用 替换空格如果它跟随单个字母