Php/docs/tidy.examples.basic

来自菜鸟教程
跳转至:导航、​搜索

Tidy example

This simple example shows basic Tidy usage.

Example #1 Basic Tidy usage

<?phpob_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();// Outputecho $tidy;?>