Compress on the fly a directory in tar.gz format using PHP
问题 I want to compress (on the fly) a directory in tar.gz format using PHP. I know it can be done with exec or using this code (using ZIP format) but my host doesn't support exec and hasn't installed the zip extension of PHP. After searching the internet I came across this PHP code: <?php // Computes the unsigned Checksum of a file’s header // to try to ensure valid file // PRIVATE ACCESS FUNCTION function __computeUnsignedChecksum($bytestring) { for($i=0; $i<512; $i++) $unsigned_chksum += ord(