Have I misunderstood what heredoc should do?

后端 未结 4 1009
小鲜肉
小鲜肉 2021-01-20 13:03

I\'m very new to PHP so I know I am missing something obvious here - I thought the heredoc function is supposed to retain formatting, line breaks, etc. But whenever I test

4条回答
  •  攒了一身酷
    2021-01-20 13:40

    Because you said "testing with MAMP" I assume, that you use your webbrowser to display the content. Thats a slightly wrong approach, because the webbrowser itself strips down any unnecessary whitespaces. Look at the source of the page you display in your browser and you will see the "real" content.

提交回复
热议问题