Link to home
Start Free TrialLog in
Avatar of catonthecouchproductions
catonthecouchproductionsFlag for United States of America

asked on

PHP tidy code

I am wondering if anyone knows of a PHP code tidier, I have seen: http://prettyprinter.de/ But try to tidy some PHP and it changes <b> to the &3t, like that and messes with my HTML.

Any suggestions on a PHP cody tidier?
Avatar of Joe Wu
Joe Wu
Flag of Australia image

You can try  SourceFormatX:
http://www.textrush.com/formatx.htm

Hope this helps.
Also for your HTML you can try this see how good it works:
http://www.phpbuilder.com/manual/en/ref.tidy.php
Avatar of catonthecouchproductions

ASKER

I am also on a Mac any suggestions there?
ASKER CERTIFIED SOLUTION
Avatar of Joe Wu
Joe Wu
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thats a good point, get you use to your own code, etc.
yep, and you know that you woudn't run into any trouble.
A good practice though is to try and keep your code tidy when writing it, so that you don't have to do this at the end!

Indentation and commenting your code is an essential practice to good programming for any language.
I know :) I need to keep that in mind, haha.
All good :)

sorry i couldn't suggest a straight solution to your problem, but hopefully what i said has helped in some way.
Thats fine! Thanks anyway. Have you tried that link you sent me? Just curious to see how well code tidiers work, trial run.

Ryan
Which one are you talking about? SourceFormatX?
I had that installed for a while, it does do a reasonable job at tidying it up, however I don't like the feeling of letting another program take control of my code, so eventually i abandoned it. :)
Haha...yeah, I was talking about the PHP add on the php site. Are you talking about SourceFormatX?
Yes sorry was talking about the wrong thing:p

as for the other one, i used it a while back, it was OK.

There is this new one (HTML TIdy) for PHP5, looks very cool and easy to use if you are thinking about tidying up your code using php:
http://devzone.zend.com/node/view/id/761

Oh nice, let me take a look at this, does that just do PHP? Or HTML/PHP as well.

I couldnt really tell from the site.
i think it does html side of things only (css, html, etc...not sure about javascript), as it is CALLED from PHP, so it can't tidy itseif :P
Hahahaha valid point!

RYan