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!
Moderator: General Moderators
Todd_Z
Forum Regular
Posts: 708 Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan
Post
by Todd_Z » Thu Nov 25, 2004 9:54 pm
I'm looking for a script that when I feed it a file, it reads through the html and source formats it.... Anyone seen one of these? Thanks.
Todd_Z
Forum Regular
Posts: 708 Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan
Post
by Todd_Z » Thu Nov 25, 2004 10:23 pm
For example, it would turn
<table><tr>
<td><B></b>random text</td></tr>
</table>
to =>
<table>
<tr>
<td>Random text</td>
</tr>
</table>
With the right spacing, which i can't do here...
josh
DevNet Master
Posts: 4872 Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida
Post
by josh » Thu Nov 25, 2004 10:30 pm
Phenom wrote: describe: "formats it"
I think he means "clean up the code" like indent and put tags on their own lines like
Code: Select all
<table><tr><td>stuff</td></tr></table>
would format to
Code: Select all
<table>
<tr>
<td>stuff</td>
</tr>
</table>
jl
Forum Commoner
Posts: 53 Joined: Tue Nov 09, 2004 12:05 am
Post
by jl » Thu Nov 25, 2004 11:13 pm
Todd_Z
Forum Regular
Posts: 708 Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan
Post
by Todd_Z » Thu Nov 25, 2004 11:57 pm
Hmmm.... well that seems to be a program, im looking for a script at runtime... like a php script in itself that i can have read the url given and format it.
Todd_Z
Forum Regular
Posts: 708 Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan
Post
by Todd_Z » Fri Nov 26, 2004 10:42 am
It looks like that has no spacing, i'm really looking for a script, not built in functions so that i can tweak it to make the style how i want it to be...
Steveo31
Forum Contributor
Posts: 416 Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA
Post
by Steveo31 » Fri Nov 26, 2004 4:52 pm
Bunch on google... "html code beautifier" will bring back a bunch. Most you gotta pay for, if not all.
Todd_Z
Forum Regular
Posts: 708 Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan
Post
by Todd_Z » Fri Nov 26, 2004 6:01 pm
Im looking for a runtime script, those all look like programs...
rehfeld
Forum Regular
Posts: 741 Joined: Mon Oct 18, 2004 8:14 pm
Post
by rehfeld » Fri Nov 26, 2004 6:14 pm
have you tried hotscripts.com ?
timvw
DevNet Master
Posts: 4897 Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium
Post
by timvw » Fri Nov 26, 2004 7:50 pm
tidy can clean up... and make it valid xhtml.. which is xml... thus you can write an xslt that transforms it to whatever you like..