« 例
tidy »

Tidy の例

このシンプルな例は、Tidy の基本的な使い方を示しています。

例1 Tidy の基本的な使用法

<?php
ob_start();
?>
<html>a html document</html>
<?php
$html = ob_get_clean();

// 設定
$config = array(
           'indent'         => true,
           'output-xhtml'   => true,
           'wrap'           => 200);

// Tidy
$tidy = new tidy;
$tidy->parseString($html, $config, 'utf8');
$tidy->cleanRepair();

// 出力
echo $tidy;
?>

関連キーワード:
Tidy   tidy   基本的   config   使い方   start   document   indent   output   xhtml   wrap   parseString   cleanRepair
関連する関数・ページ:
function.tidy-config-count   ref.tidy   function.tidy-get-output   function.tidy-warning-count   tidy.getrelease   tidy.configuration