tidy::__constructとは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > tidy::__constructの意味・解説 

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() も参照ください。



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「tidy::__construct」の関連用語

tidy::__constructのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



tidy::__constructのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2025 by the PHP Documentation Group.

©2025 GRAS Group, Inc.RSS