PHP: tidy::__construct - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

tidy_diagnose tidy_config_count

Last updated: Sat, 27 Jan 2007

view this page in

# tidy::__construct

(no version information, might be only in CVS)

tidy::__construct -- Constructs a new tidy object

## Description

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

tidy::__construct() constructs a new tidy object.

If the `filename` parameter is given, this function will also read that file and initialize the object with the file, acting like tidy_parse_file().

Параметр `config` может быть передан как в виде строки, так и в виде массива. В случае передачи строки, параметр рассматривается как путь к конфигурационному файлу, в противном случае содержание массива рассматривается как собственно конфигурация. За подробной информацией о опциях обращайтесь к http://tidy.sourceforge.net/docs/quickref.html.

Возможные значения параметра `encoding`: ascii, latin1, raw, utf8, iso2022, mac, win1252, utf16le, utf16be, utf16, big5 и shiftjis.

Пример 1. tidy::__construct() example

`<?php
$html = <<< HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>title</title></head>
<body>
<p>paragraph <bt />
text</p>
</body></html>
HTML;
$tidy = new tidy;
$tidy->parseString($html);
$tidy->CleanRepair();
if ($tidy->errorBuffer) {
echo "The following errors were detected:\n";
echo $tidy->errorBuffer;
}
?>`

Результат выполнения данного примера:

    The following errors were detected:
    line 8 column 14 - Error: <bt> is not recognized!
    line 8 column 14 - Warning: discarding unexpected <bt>

See also tidy_parse_file() and tidy_parse_string().

add a note User Contributed Notes
tidy::__construct
There are no user contributed notes for this page.
tidy_diagnose tidy_config_count

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST