我正在使用 preg_match_all 过滤掉字符串
我在 preg_match_all 中提供的字符串是
$text = "Friedric'h Wöhler"
之后我使用
preg_match_all('/(\"[^"]+\"|[\\p{L}\\p{N}\\*\\-\\.\\?]+)/', $text, $arr, PREG_PATTERN_ORDER);
当我打印 $arr 时得到的结果是
Array
(
[0] => Array
(
[0] => friedric
[1] => h
[2] => w
[3] => ouml
[4] => hler
)
[1] => Array
(
[0] => friedric
[1] => h
[2] => w
[3] => ouml
[4] => hler
)
)
不知何故, ö 字符被 ouml 取代,我不确定如何解决这个问题
我期待以下结果
Array
(
[0] => Array
(
[0] => Friedric'h
[1] => Wöhler
)
)