line breaks, etc. in HTML code

Hello.

I think I remember seeing a way to insert line breaks in HTML code that is generated w/ PHP, but I don’t remember how that works.

I’m not talking about
, I’m talking about a line break in the generated HTML code itself (i.e. visible to the site visitor when they view the HTML source).

For example, if I have:

<?php for ($i = 1; $i <= 3; $i++) { echo "Hello World<br />"; } ?>

The resulting HTML code would be:

Hello World<br />Hello World<br />Hello World<br />

but I would like:

Hello World<br /> Hello World<br /> Hello World<br />

Of course in either case, the actual resulting content would be the same. I just want to tidy things up in the source code.

Is there a way to achieve this result?

Thanks,

Paul

[php]<?php for ($i = 1; $i <= 3; $i++) { echo "Hello World
n"; } ?>[/php]

only works with double quotes. meaning ‘n’ wouldn’t work.

Sponsor our Newsletter | Privacy Policy | Terms of Service