Re: Reducing size of htm output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kirsten wrote:
I need to reduce the size of the HTM generated by a PHP script for faster
transmission. I'm actually using ob_start("ob_gzhandler") but I also need
some function to reduce the size of javascript blocks, deletion of
unnecesary blanks, etc.

For example, Code A:
<head><script>

function any(){
 somecode;
}

</script>
</head>

<body>
</body>

can be converted to Code B:
<head><script> function any(){  somecode; }</script></head><body></body>

preg_replace('/s+/', ' ', $html);

but watch out, this js code will work:

var v
alert(v)

this one will not:

var v alert(v)


1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some user has already done it? 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE 5.5+?

don't know. but you can detect these browsers and turn compression off

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux