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
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.