If you using it as command line script this would work. I would use PHP_EOL
for this since it chooses the right line break for the OS.
However if you are working with HTML (viewing the result in browser for example) you have to use the HTML way of linebreaks which is: