php :: new line in textarea?

后端 未结 10 2016
暖寄归人
暖寄归人 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:43

    $row['content']=stripslashes($row['content']);
    $row['content']=str_replace('
    ',"newline",$row['content']); $row['content']=htmlentities($row['content']); $row['content']=str_replace('newline',"
    ",$row['content']);

提交回复
热议问题