note 19142 added to ref.outcontrol
| From: | fredrik at php2 dot chek dot com | Date: | Sun, 17 Feb 2002 23:53:25 +0000 |
| Subject: | note 19142 added to ref.outcontrol | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26721@lists.php.net to get a copy of this message | ||
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;
?>
--
http://www.php.net/manual/en/ref.outcontrol.php
http://master.php.net/manage/user-notes.php?action=edit+19142
http://master.php.net/manage/user-notes.php?action=delete+19142
http://master.php.net/manage/user-notes.php?action=reject+19142