DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Logan has posted 12 posts at DZone. View Full User Profile

Tidy Remote HTML (using A Web Service)

06.28.2007
| 4927 views |
  • submit to reddit
        // Clean up some code using a web service. If you need to do this more quickly I suggest using a local tidy installation
// rather than my web service, but this is nice and easy. :)

function tidied($url) {
  /* Cleans up a page via Tidy, returning the cleaned up html as a string
   * By Logan Koester <logan@logankoester.com> 2007-06-28
   * Props to http://infohound.net/tidy */
  return file_get_contents("http://logankoester.com/tools/tidy.php?q=$url");
}