note 19142 deleted from ref.outcontrol by nlopess
| From: | nlopess@php.net | Date: | Mon, 31 May 2004 16:03:21 +0000 |
| Subject: | note 19142 deleted from ref.outcontrol by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70351@lists.php.net to get a copy of this message | ||
Note Submitter: fredrik at rambris dot com
----
A cool way to use this is to run the output through HTML-tidy and get really nicelooking output
without having to manually add indenting etc. Try this at the end (after doing an ob_start before
outputting anything).
<?php
$str=addslashes(ob_get_contents());
$fp=popen("echo \"" . $str . "\" | /usr/bin/tidy -i -u -q -latin1
--indent-spaces 1 -wrap 0", "r");
@$newstr=fread($fp, 99999);
ob_end_clean();
Header( "Content-length: " . strlen( $newstr ) );
echo $newstr;
?>