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)

  • 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 <> 2007-06-28
   * Props to */
  return file_get_contents("$url");