【发布时间】:2023-03-03 23:42:01
【问题描述】:
要正确解析双引号字符串(我无法更改),我必须执行以下操作:
$string = '15 Rose Avenue\n Irlam\n Manchester';
$string = str_replace('\n', "\n", $string);
print nl2br($string); // demonstrates that the \n's are now linebreak characters
到目前为止,一切都很好。
但在我给定的字符串中,有\xC3\xA4 之类的字符。有很多这样的字符(以\x..开头)
如何使用换行符正确解析它们,如上所示?
【问题讨论】: