0

我找到了这个解决方案

$content=preg_replace('/[^\pL\p{Zs}]+/u', '', $string);

它会删除除 utf-8 字符之外的所有内容,但我需要除 utf-8 字符和数字之外的所有内容,这可能吗?

4

1 回答 1

1

您可以尝试在范围内添加数字 (\d)

$content=preg_replace('/[^\d\pL\p{Zs}]+/u', '', $string);
于 2012-10-09T13:37:31.203 回答