tidy::__construct
Constructs a new tidy object
Description
objecttidy::__construct
stringfilename
mixedconfig
stringencoding
booluse_include_path
tidy::__construct constructs a new tidy object.
If the filename parameter is given, this function
will also read that file and initialize the object with the file,
acting like tidy_parse_file.
&tidy.conf-enc;
tidy::__construct example
title
paragraph
text
HTML;
$tidy = new tidy;
$tidy->parseString($html);
$tidy->CleanRepair();
if ($tidy->errorBuffer) {
echo "The following errors were detected:\n";
echo $tidy->errorBuffer;
}
?>
]]>
The above example will output:
is not recognized!
line 8 column 14 - Warning: discarding unexpected
]]>
See also tidy_parse_file and
tidy_parse_string.