For PHP, I don't know, but for HTML I use Tidy. I have no idea how it'll handle PHP, but if you have PHP embedded in your HTML, you probably have bigger problems than making it look good.
The PHP engine lets you create dynamic Web pages. PHP also reads HTML, so you can save an HTML file with a PHP extension and upload the new file to your server. After you upload the file to your ...