Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: tidy::__construct - Manual
[go: Go Back, main page]

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

search for in the

tidy_diagnose" width="11" height="7"/> <tidy_config_count
Last updated: Mon, 05 Feb 2007

view this page in

tidy::__construct

(No version information available, might be only in CVS)

tidy::__construct — 新規 Tidy オブジェクトを生成する

説明

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

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

もし filename パラメータが与えられた場合、 この関数はファイルを読み込み、tidy_parse_file() のように実行してファイルに基づいたオブジェクトを初期化します。

configパラメータは、配列または 文字列として指定することができます。文字列として指定した場合には設定ファイルの名前として解釈され、 そうでない場合はオプション自体として解釈されます。各オプションに関する説明については、 » http://tidy.sourceforge.net/docs/quickref.html を参照してください。

encoding パラメータは、文書を入力/出力する際のエンコーディングを 設定します。encoding には次の値を使用可能です。 ascii, latin1, raw, utf8, iso2022, mac, win1252, utf16le, utf16be, utf16, big5, shiftjis

例 2359. tidy::__construct() の例

<?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>

      

tidy_parse_file(), tidy_parse_string() も参照ください。



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

tidy_diagnose" width="11" height="7"/> <tidy_config_count
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites