PHP/HTML/tidy parse string
Версия от 13:37, 26 мая 2010; (обсуждение)
Passing Tidy Options at Runtime
<source lang="html4strict">
<?php
$options = array("show-body-only" => true); $tidy = tidy_parse_string("HelloWorld!</B>", $options); echo $tidy;
?>
</source>
Retrieving a Document from Tidy
<source lang="html4strict">
<?php
$tidy = tidy_parse_string("<B>This is a string"); $data = tidy_get_output($tidy); echo $tidy;
?>
</source>
Using tidy_clean_repair()
<source lang="html4strict">
<?php
$tidy = tidy_parse_string("This is a simple,</I> but <B>malformed HTML Document<U>"); tidy_clean_repair($tidy); echo $tidy;
?>
</source>