PHP Compression and archive extension summary php extension MONGO php extensions PHP extension pthread

Source: Internet
Author: User
Tags lzf rar
Summary of PHP compression and archive extensions

To open the PHP user manual, we can see the following library of functions for processing compressed files,

Bzip2,lzf,phar,rar,zip,zlib

So what are the actual application scenarios for each of these, and we'll pick one up next.

BZIP2:

The official introduction is this:

The BZIP2 function is used to transparently read and write bzip2 (. bz2) Compressed files.

Self-Understanding as follows:

This library is a file that is processed with a. bz2 extension, which is a compact format that is commonly used under Linux, but can also be used under Windows. The specific operation is to compress files, unzip, open, write, read, close and so on. For specific use of the function, write your own test case.

LZF:

The official introduction is this:

LZF is a very fast compression algorithm, ideal for saving space with only slight speed cost. It can be optimized-speed or space at the time of compilation.

Self-Understanding as follows:

LZF is a very fast compression algorithm. It can take very little time to achieve an ideal space saving effect. It can be used to optimize speed or space at compile time.

You can use the compression function in this function library, will be compressed by a string, return the compressed string, you can also use this algorithm to compress the string in which the decompression function decompression.

Phar:

It is understood here that, with this extension, multiple PHP files can be packaged into a PHP archive (. Phar) document. And you can directly use the individual files inside. You can also convert between three file formats in a tar zip Phar.

Rar:

This extension gives only a way to read the RAR file. Cannot write.

Zip:

This extension allows you to read and write the zip archive transparently and the files inside them.

Zlib:

This module allows you to transparently read and write gzip (. GZ) Compressed Files


The above describes the PHP compression and archive extension summary, including PHP, the content of the extension, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.