php :: new line in textarea?

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

    Try

    $text = 'text line one' . PHP_EOL . 'text line two';
    echo '';
    

    Will add each text on reparate line in texarea.

提交回复
热议问题