Description
Style procédural
tidy
tidy_parse_file ( string filename [, mixed config [, string encoding [, bool use_include_path]]] )
Style orienté objet (méthode)
bool
tidy->parseFile ( string filename [, mixed config [, string encoding [, bool use_include_path]]] )
tidy_parse_file() analyse le fichier spécifié.
Le paramètre config peut
prendre la forme d'un tableau ou d'une chaîne de caractères. Sous forme
de chaîne, il représente le nom du fichier de configuration et sinon, c'est
un tableau avec les options de configuration. Lisez http://tidy.sourceforge.net/docs/quickref.html pour en savoir plus sur chaque
option.
Le paramètre encoding spécifie le jeu de caractères
utilisé pour les documents en entrées et sorties. Les valeurs possibles de
encoding sont :
ascii, latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16,
utf16le, utf16be, big5 et shiftjis.
Exemple 1. Exemple avec tidy_parse_file()
<?php $tidy = tidy_parse_file('file.html');
$tidy->cleanRepair();
if(!empty($tidy->error_buf)) { echo 'Les erreurs et avertissements suivants ont été recontrés :'."\n"; echo $tidy->error_buf; } ?>
|
|
Note : Les paramètres optionnels
config et encoding
ont été ajoutés en Tidy 2.0.
Voir aussi
tidy_parse_string(),
tidy_repair_file() et
tidy_repair_string().