Formatting output
| From: | listas at fernandomarcelo dot com | Date: | Mon, 11 Jun 2007 12:57:12 +0000 |
| Subject: | Formatting output | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-256593@lists.php.net to get a copy of this message | ||
Hello,
I would like to format the output of a PHP page into a single line and use
gzip compression too.
I know that i can use something like this to get in a single line ( will
workout on this function later to remove spaces ).
<?php
function my_function( $buffer )
{
$str = str_replace( "\n" , " " , $buffer );
return $str;
}
ob_start("my_function");
echo 'hello';
ob_end_flush();
?>
And gzip compression is used with
<?php
ob_start("ob_gzhandler");
echo 'hello';
ob_end_flush();
?>
Is there a way to "mix" those codes?
Thanks.