Keeping indentation when pasting HTML from MySQL
I use MySQL and PHP to populate parts of a site, often with HTML stored in a TEXT field. I like to have my HTML indented so that the source is neat and easy to read, e.g .:
<body>
<div>
<p>Blahblah</p>
</div>
</body>
However, when HTML is pulled from MySQL, I get:
<body>
<div>
<p>Blahblahblah</p>
</div>
</body>
It's pretty ugly when a lot of HTML is added to the DIV, which is significantly indented. How can I stop this? FYI, I am using wordwrap () so that each line is not too long.
+2
a source to share