dongwuying0221 2015-03-21 22:25 采纳率: 0%
浏览 39
已采纳

如何解析单引号字符串中的字符?

To get a double quoted string (which I cannot change) correctly parsed I have to do following:

$string = '15 Rose Avenue
 Irlam
 Manchester'; 
$string = str_replace('
', "
", $string);
print nl2br($string); // demonstrates that the 
's are now linebreak characters

So far, so good. But in my given string there are characters like \xC3\xA4. There are many characters like this (beginning with \x..) How can I get them correctly parsed as shown above with the linebreak?

  • 写回答

2条回答 默认 最新

  • drhqkz3455 2015-03-21 22:36
    关注

    You can use

    $str = stripcslashes($str);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?