I saw Yoav's blog entry on Tidy and for a brief moment, in the first paragraph, thought that there was actually a phptidy utility. Alas, it was not to be.
Perl has had perltidy for some time, and, as I understand, it's a pretty hard thing to do. But I keep hoping that someone will do the same thing for PHP.
Meanwhile, fortunately, php syntax is enough like perl that I can use perltidy to reformat php code about half the time (I have a vim macro that runs perltidy on the selected block of text) - the other half, it complains about syntax errors and screws things up pretty well.


Of course, if you have autoindent/smartindent set up in your /vimrc file, you can get a half decent result by putting your cursor on an opening curly bracket and pressing =% - which will usually indent everything through the matching closing bracket.
Sometimes you'll get some strange results though - especially if you have any brackets that are in comments - but it's always worth a shot as a first strike.
Stumbled across this in an old email. You may want to give it a look: http://pear.php.net/package/PHP_Beautifier