php :: new line in textarea?

后端 未结 10 2018
暖寄归人
暖寄归人 2020-12-09 09:02

How do you create a new line in a textarea when inserting the text via php?

I thought it was \\n but that gets literally printed in the textarea.

<
10条回答
  •  醉酒成梦
    2020-12-09 09:37

    What Alay Geleynse said was right, I had the same problem as you and the issue was due to the escape characters (\r, \n) was there. To 'unescaped' the variable I used $var = stripcslashes($var) and it's shown correctly

提交回复
热议问题