\n
must be in double quotes!
echo "hello\nworld";
Output
hello
world
A nice way around this is to use PHP as a more of a templating language
<p>
Hello <span><?php echo $world ?></span>
</p>
Output
<p>
Hello <span>Planet Earth</span>
</p>
Notice, all newlines are kept in tact!