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

前端 未结 7 1177
青春惊慌失措
青春惊慌失措 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 <br>

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

    0 讨论(0)
提交回复
热议问题