Created
August 1, 2009 19:34
-
-
Save markwatson/159782 to your computer and use it in GitHub Desktop.
This file contains 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
The first is to use the object oriented way: | |
$config = array( | |
'indent' => true, | |
'output-xml' => true, | |
'wrap' => 200); | |
// Tidy | |
$tidy = new tidy; | |
$tidy->parseString($xml, $config, 'utf8'); | |
$tidy->cleanRepair(); | |
$result = (string) $tidy; | |
But I get the error: | |
Fatal Error: Class ‘tidy’ not found | |
The second is to just call the function like so: | |
$result = tidy_parse_string($xml, $config, 'utf8'); | |
However then I get the error: | |
tidy_parse_string() expects exactly 1 parameter 3 given |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment