note 39939 deleted from ref.outcontrol by nlopess
| From: | nlopess@php.net | Date: | Mon, 16 Feb 2004 14:39:59 +0000 |
| Subject: | note 39939 deleted from ref.outcontrol by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65214@lists.php.net to get a copy of this message | ||
Note Submitter: master@masteru.ru
----
Thats just a simple way to optiomize your HTML code:
<?
function optimize_flush($buffer) {
// Óäàëèì âñå ïðîáåëû â HTML
$buffer = str_replace("\r\n", ' ', $buffer);
$buffer = str_replace("\n", ' ', $buffer);
$length = strlen($buffer);
while ($length != $oldlength) {
$buffer = str_replace(' ', ' ', $buffer);
$oldlength = $length;
$length = strlen($buffer);
}
$buffer = str_replace('> ', '>', $buffer);
$buffer = str_replace(' <', '<', $buffer);
return $buffer;
}
ob_start('optimize_flush');
?>
Just include this before output. Twill be very hard to understand HTML code after this operation
(may be its a plus), but HTML code bacomes much smaller.
The only bug: Don't use it whith filled textareas.