PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<html><body>
<p>
<?php echo "This is line1\n This is line 2"; ?>
</p>
<p>
<?php echo "This is line1<br />\nThis is line 2"; ?>
</p>
<pre>
<?php echo "This is line1\nThis is line 2"; ?>
</pre>
</body></html>
<html><body>
<p>
This is line1
This is line 2
</p>
<p>
This is line1 <br />
This is line 2
</p>
<pre>
This is line1
This is line 2
</pre>
</body></html>
Depending on what you're doing (if you're formatting the source code then ignore me and go back to volka's post), if you're trying to format the display then you may need nl2br(): http://www.php.net/manual/en/function.nl2br.php