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

search for in the

tidy::parseString> <tidy::isXml
Last updated: Fri, 13 Nov 2009

view this page in

tidy::parseFile

tidy_parse_file

(PHP 5, PECL tidy >= 0.5.2)

tidy::parseFile -- tidy_parse_fileファイルまたは URI にあるマークアップをパースする

説明

手続き型

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

オブジェクト指向型

bool tidy::parseFile ( string $filename [, mixed $config [, string $encoding [, bool $use_include_path = false ]]] )

与えられたファイルをパースします。

パラメータ

filename

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

config

config には配列あるいは文字列を渡します。 文字列を渡した場合は設定ファイルの名前、 それ以外の場合は設定そのものとして解釈されます。

オプションについての説明は » http://tidy.sourceforge.net/docs/quickref.html を参照ください。

encoding

encoding は入出力ドキュメントのエンコーディングを設定します。 指定できるエンコーディング名は asciilatin0latin1rawutf8iso2022macwin1252ibm858utf16utf16leutf16bebig5 および shiftjis です。

use_include_path

include_path からファイルを探します。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 tidy::parseFile() の例

<?php
$tidy 
= new tidy();
$tidy->parseFile('file.html');

$tidy->cleanRepair();

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

注意

注意: オプションのパラメータ config_optionsenconding は Tidy 2.0 で追加されました。

参考



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

tidy::parseString> <tidy::isXml
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites