I would like to gzip compress a file on my server using PHP. Does anyone have an example that would input a file and output a compressed file?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Also, you could use php's wrappers, the compression ones. With a minimal change in the code you would be able to switch between gzip, bzip2 or zip.
change
compress.zlib://
to(see comment to this answer about zip compression), or tocompress.zip://
for zip compressioncompress.bzip2://
to bzip2 compression.