Created
August 2, 2008 15:40
-
-
Save tommorris/3744 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function tidyInput($input) { | |
exec("echo " . escapeshellarg($input) . " | /usr/bin/tidy --indent auto --indent-spaces 2 --output-xhtml yes --show-errors 0 --show-warnings no --quiet yes --tidy-mark no --show-body-only yes", $response); | |
return implode("\n", $response); | |
} | |
/* this is for use in my blogging application to clean up fragments of XHTML on my own site. Clean your inputs and prevent failure. :) -tom */ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment