编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 范例
  • tidy »
  • PHP Manual
  • 范例
  • Tidy example

Tidy example

This simple example shows basic Tidy usage.

Example #1 Basic Tidy usage

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

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

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

// Output
echo $tidy;
?>

相关文章
php tidy the tidy classphp 范例 a complete php/ffi/preloading examplephp 范例 basic pecl/haru examplephp tidy 简介php 范例 basic examplephp tidy tidy 函数php 范例 procedural pecl/rrd examplephp tidy run configured diagnostics on parsed and repaired markupphp 范例 tidy examplephp tidy 范例php tidy get current tidy configurationphp tidy get the detected html version for the specified documentphp tidy returns the value of the specified configuration option for the tidy documentphp tidy returns the documentation for the given option namephp tidy get release date version for tidy libraryphp tidy return warnings and errors which occurred parsing the specified documentphp tidy repair a file and return it as a stringphp tidy repair a string using an optionally provided configuration filephp tidy returns a tidynode object representing the root of the tidy parse treephp tidy 安装/配置
关注编程学问公众号
编程学问网 湘ICP备20001732号