0
我發現這個解決方案php preg_replace charac。 +數字+僅UTF-8
$content=preg_replace('/[^\pL\p{Zs}]+/u', '', $string);
它消除了除UTF-8字符的一切,但我需要不同的UTF-8字符和數字這可能嗎?
我發現這個解決方案php preg_replace charac。 +數字+僅UTF-8
$content=preg_replace('/[^\pL\p{Zs}]+/u', '', $string);
它消除了除UTF-8字符的一切,但我需要不同的UTF-8字符和數字這可能嗎?
您可以嘗試在範圍內添加數字(\ d)
$content=preg_replace('/[^\d\pL\p{Zs}]+/u', '', $string);