Manuel PHP

tidy_repair_string

(PHP 5, PECL tidy >= 0.7.0)

tidy_repair_string Répare une chaîne HTML en utilisant un fichier de configuration optionnel

Description

string tidy_repair_string ( string $data [, mixed $config [, string $encoding ]] )

tidy_repair_string() répare la chaîne fournie.

Exemple #1 Exemple avec tidy_repair_string()

  1. <?php
  2. ob_start();  
  3. ?>
  4.  
  5. <html>
  6. <head>
  7. <title>test</title>
  8. </head>
  9. <body>
  10. <p>error</i>
  11. </body>
  12. </html>
  13.  
  14. <?php
  15.  
  16. $buffer = ob_get_clean();  
  17. $tidy = tidy_repair_string($buffer);  
  18.  
  19. echo $tidy;  
  20. ?> 

L'exemple ci-dessus va afficher :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>test</title> </head> <body> <p>error</p> </body> </html>

Note: Les paramètres optionnels config et encoding ont été ajoutés en Tidy 2.0.

Voir aussi tidy_parse_file(), tidy_parse_string() et tidy_repair_file().


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique