Elegant solution for line-breaks (PHP)

后端 未结 8 2032
太阳男子
太阳男子 2020-12-08 14:28
$var = \"Hi there\".\"
\".\"Welcome to my website\".\"
;\" echo $var;

Is there an elegant way to handle line-breaks in PHP? I\'

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 15:09

    Because you are outputting to the browser, you have to use
    . Otherwise there is \n and \r or both combined.

提交回复
热议问题