cry of war Posted July 17, 2007 Share Posted July 17, 2007 I heard rumors that you could Compress PHP files on Transfer and Uncompress files when the PHP file is received. Does anyone one know how to do this because it would save me a lot on bandwidth cost Quote Link to comment https://forums.phpfreaks.com/topic/60355-solved-compression/ Share on other sites More sharing options...
MadTechie Posted July 17, 2007 Share Posted July 17, 2007 what about the manual! zlib & wrappers compression & ob_gzhandler My PHP version is 5.2.1 For windows. If browser doesn't support compressed , ob_start('ob_gzhandler') returns the original string, but $str = ob_gzhandler ( $buffer, 5 ) returns false; <?php /* 1.php */ ob_start('ob_gzhandler') ; echo 'This is a string.'; ?> <?php /* 2.php */ header("Content-Encoding: gzip"); $buffer = 'This is a string.'; $str = ob_gzhandler ( $buffer, 5 ) ; if($str===false){ echo 'ob_gzhandler() returns false.'; }else{ echo $str; } ?> <?php /* 3.php */ echo file_get_contents('http://www.php.net/1.php'); echo file_get_contents('http://www.php.net/2.php'); /* result: This is a string.ob_gzhandler() returns false. */ ?> Quote Link to comment https://forums.phpfreaks.com/topic/60355-solved-compression/#findComment-300288 Share on other sites More sharing options...
cry of war Posted July 17, 2007 Author Share Posted July 17, 2007 Do some Explorers run into errors with this function???? Quote Link to comment https://forums.phpfreaks.com/topic/60355-solved-compression/#findComment-300295 Share on other sites More sharing options...
MadTechie Posted July 17, 2007 Share Posted July 17, 2007 Nope..(not what i have found) i think your thinking of the vbscript compression for uploads!! only worked on IE (was poop) Quote Link to comment https://forums.phpfreaks.com/topic/60355-solved-compression/#findComment-300299 Share on other sites More sharing options...
cry of war Posted July 17, 2007 Author Share Posted July 17, 2007 ok thank you Quote Link to comment https://forums.phpfreaks.com/topic/60355-solved-compression/#findComment-300309 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.