(PHP 5, PECL tidy:0.7-1.2)
tidy_repair_string — Répare une chaîne HTML en utilisant un fichier de configuration optionnel
tidy_repair_string() répare la chaîne fournie.
Exemple 2730. Exemple avec tidy_repair_string()
<?php
ob_start
();
?>
<html>
<head>
<title>test</title>
</head>
<body>
<p>error</i>
</body>
</html>
<?php
$buffer
=
ob_get_clean
();
$tidy
=
tidy_repair_string
(
$buffer
);
echo
$tidy
;
?>
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() .