Click to See Complete Forum and Search --> : PHP/HTML beautifier that really does a good job?


aqw
02-17-2005, 07:04 PM
Hi!

Does it exist a PHP/HTML beautifier that really does a good job?

I have tried them all (polystyle,...)

Thank you

Weedpacket
02-18-2005, 08:59 AM
I write beautifully to start with. Makes debugging easier.

vaaaska
02-18-2005, 09:23 AM
Originally posted by aqw
Does it exist a PHP/HTML beautifier that really does a good job?


Lately, I've been beautifying my php/html with little bitmapped images of birdies, fishies, twigs, flowers and the like. Really...

;)

piersk
02-18-2005, 09:43 AM
Have a look at HTML Tidy (http://tidy.sourceforge.net/)... it'll tidy up your HTML a treat

pohopo
02-18-2005, 02:11 PM
I agree with weedpacket, just write it clean in the first place. It is not that much work.

TheDefender
02-18-2005, 07:44 PM
In fairness to aqw's question, even the best coders inadvertently add a space here, or a tab there... There's nothing wrong with using a tidier as a backup to good coding practices.

Weedpacket
02-18-2005, 10:51 PM
Well, I do use tidy to strip out all the extraneous whitespace in my HTML, and to make sure I've got all the /> in empty tags in place. And check other things like that.

I've also got a wee script that I use to strip all trailing whitespace off all lines in a text file.

dalecosp
02-24-2005, 06:43 PM
What I need is a PHP beautifier. Something to take all the crappy code I wrote when I was a rank newb, and change it to the awful stuff that I write now that's so much better.

:D

Elizabeth
02-24-2005, 07:05 PM
<ot>Heh, dc I just realized what your av was. Is that you? lol </ot>

Weedpacket
02-24-2005, 07:46 PM
Originally posted by dalecosp
What I need is a PHP beautifier. Something to take all the crappy code I wrote when I was a rank newb, and change it to the awful stuff that I write now that's so much better.

:D

$sql = "SELECT * FROM foobar";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
if($row['thingy']=='1')
{
$womble = $womble+1;
}
}

// ==>

$womble = mysql_result(mysql_query("select count(*) from foobar where thingy=1"),0);

dalecosp
02-24-2005, 09:46 PM
Originally posted by Elizabeth
<ot>Heh, dc I just realized what your av was. Is that you? lol </ot> Nah, just some Zealot donating to the Cause ... ;)

dalecosp
02-24-2005, 09:48 PM
Originally posted by Weedpacket
$womble = $womble+1; Hmm. Been working in FoxPro again? :p