Jump to content

formating page source HTML


niche

Recommended Posts

I have a page that's generated by a php script. What's the easiest way to format the extremely long line of html that's in page source so it's easier to read? I'd like to avoid having to avoid manually format the page source so I can read it more easily or am i stuck having to format the page source manually.

Link to comment
Share on other sites

The simplest thing is to add newline characters: "\n" They can be embedded in loops at appropriate places, for instance.You can try to add tab characters ("\t") but that gets to be a hassle after a while.

Link to comment
Share on other sites

Thanks for the tip. w3 says /n is js. how do would I insert it in a line like this:

echo '<a class="three" href="'.$row['locpage'].'">'.$row['locname'].' '.$offer.'</a>';

Link to comment
Share on other sites

Neat. Now I'm cookin with gas. Thanks to Deirdre's Dad and dsonesuk.

Link to comment
Share on other sites

FWIW, \n is pretty universal in languages derived from C, including JS and PHP. For it to be correctly interpolated in PHP, remember that it must be wrapped in double quotations (which I'm sure you're doing, since it works). Languages derived from Godforsaken BASIC have other ideas. No flames, please. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...