Welcome Guest, Not a member yet? Register   Sign In
Maintain (X)HTML Indentation
#1

[eluser]underskor[/eluser]
How do you stop PHP reverting the indent level? For example:
Code:
<?php
$variable = '<p>Lorem ipsum sit dolor amet.</p>'.chr(10);
?&gt;
[..]
    &lt;body&gt;
        &lt;?php
        echo $variable;
        echo $variable;
        echo $variable;
        echo $variable;
        ?&gt;
    &lt;/body&gt;
produces the following HTML:
Code:
[..]
    &lt;body&gt;
        <p>Lorem ipsum sit dolor amet.</p>
<p>Lorem ipsum sit dolor amet.</p>
<p>Lorem ipsum sit dolor amet.</p>
<p>Lorem ipsum sit dolor amet.</p>
    &lt;/body&gt;
I'd like it to be:
Code:
[..]
    &lt;body&gt;
        <p>Lorem ipsum sit dolor amet.</p>
        <p>Lorem ipsum sit dolor amet.</p>
        <p>Lorem ipsum sit dolor amet.</p>
        <p>Lorem ipsum sit dolor amet.</p>
    &lt;/body&gt;

Hoping there's a way to do this which doesn't involve mutilating my nicely indented/formatted PHP.


Messages In This Thread
Maintain (X)HTML Indentation - by El Forum - 02-10-2009, 12:58 AM
Maintain (X)HTML Indentation - by El Forum - 02-10-2009, 01:21 AM
Maintain (X)HTML Indentation - by El Forum - 02-10-2009, 01:31 AM
Maintain (X)HTML Indentation - by El Forum - 02-10-2009, 04:01 AM
Maintain (X)HTML Indentation - by El Forum - 02-10-2009, 04:06 AM
Maintain (X)HTML Indentation - by El Forum - 02-10-2009, 04:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB