note 39578 deleted from ref.tidy by betz
| From: | betz@php.net | Date: | Tue, 03 Feb 2004 01:25:52 +0000 |
| Subject: | note 39578 deleted from ref.tidy by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64578@lists.php.net to get a copy of this message | ||
Note Submitter:
----
just a simple way of using tidy
function ob_handler($buffer){
// for this to work you need 'tidy' set up for php see http://au.php.net/manual/en/ref.tidy.php
// this function needs to be called by ob_start() like this: ob_start("ob_handler");
// and you should end up with beautiful xhtml
tidy_setopt('clean', 1);
tidy_setopt('indent', 1);
tidy_setopt('indent-spaces',2);
tidy_setopt('output-xhtml', 1);
tidy_setopt('wrap', 200);
tidy_setopt('add-xml-decl', 1);
$buffer = tidy_repair_string($buffer);
return $buffer;
}