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

search for in the

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

view this page in

tidy::repairFile

tidy_repair_file

(PHP 5, PECL tidy >= 0.7.0)

tidy::repairFile -- tidy_repair_fileファイルを修正し、それを文字列として返す

説明

手続き型

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

オブジェクト指向型

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

与えられたファイルを修正し、それを文字列として返します。

パラメータ

filename

修正するファイル。

config

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

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

encoding

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

use_include_path

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

返り値

修正した内容を文字列で返します。

例1 tidy::repairFile() の例

<?php
$file 
'file.html';

$tidy = new tidy();
$repaired $tidy->repairfile($file);
rename($file$file '.bak');

file_put_contents($file$repaired);
?>

注意

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

参考

  • tidy::parseFile() - ファイルまたは URI にあるマークアップをパースする
  • tidy::parseString() - 文字列にストアされたドキュメントをパースする
  • tidy::repairString() - 別途提供される設定ファイルを使用して文字列を修正する


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

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