Elegant solution for line-breaks (PHP)

后端 未结 8 2028
太阳男子
太阳男子 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:06

    in php line breaks we can use PHP_EOL (END of LINE) .it working as "\n" but it cannot be shown on the ht ml page .because we have to give HTML break to break the Line..

    so you can use it using define

    define ("EOL","
    ");

    then you can call it

提交回复
热议问题