Opposite of nl2br? Is it str_replace?

后端 未结 8 1675
旧时难觅i
旧时难觅i 2020-12-02 00:07

So the function nl2br is handy. Except in my web app, I want to do the opposite, interpret line breaks as new lines, since they will be echoed into a pre-filled form.

<
8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 00:58

    Are you writing '\n'? Because \n will only be interpreted correctly if you surround it with double quotes: "\n".

    Off topic: the syntax is evil. Please don't use it for the sake of the other developers on your team.

提交回复
热议问题