PHP/HTML/tidy parse string

Материал из Web эксперт
Перейти к: навигация, поиск

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>