New line (“\n”) in PHP is not working

前端 未结 7 1197
青春惊慌失措
青春惊慌失措 2020-12-08 22:41

For some strange reason, inserting echo \"\\n\"; and other scape sequence characters are not working for me, that\'s why I am just using

7条回答
  •  攒了一身酷
    2020-12-08 23:31

    You can use the nl2br function to convert \n to

    As said before, HTML does not render \n as new line. It only recognizes the
    html tag

提交回复
热议问题