Manuál PHP Předcházející Další (PHP 5) tidy_parse_file --  Parse markup in file or URI Description Procedural style: tidy (..."/>
Forum und email
tidy_parse_file

tidy_parse_file

(PHP 5)

tidy_parse_file --  Parse markup in file or URI

Description

Procedural style:

tidy tidy_parse_file ( string filename [, mixed config [, string encoding [, bool use_include_path]]] )

Object oriented style:

bool tidy->parseFile ( string filename [, mixed config [, string encoding [, bool use_include_path]]] )

This function parses the given file.

Parametr config lze předávat jak jako pole, tak jako řetězec. Předává-li se jako řetězec, představuje název konfiguračního souboru, jinak jsou obsažené parametry přímo interpretovány. Vysvětlení všech voleb naleznete na https://tidy.sourceforge.net/docs/quickref.html

Parametr encoding nastavuje kódování pro vstupní/výstupní dokumenty. Možné hodnoty parametru encoding jsou: ascii, latin0, latin1, raw, utf8, iso202, utf16le, utf16be, utf16, mac, win1252, ibm858, big5 a shiftjis.

Příklad 1. tidy_parse_file() example

<?php
$tidy
= tidy_parse_file('file.html');

$tidy->cleanRepair();
    
if(!empty(
$tidy->errorBuffer)) {
    echo
"The following errors or warnings occured:\n";
    echo
$tidy->errorBuffer;
}
?>

Poznámka: Ve verzi Tidy 2.0 byly přidány nepovinné parametry config_options a enconding.

See also tidy_parse_string(), tidy_repair_file() and tidy_repair_string().