Home  >  Article  >  Backend Development  >  Share PHP unpack function decompression bit string implementation skills_PHP tutorial

Share PHP unpack function decompression bit string implementation skills_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:33:491141browse

We have introduced to our friends

PHP unpack function definition

to decompress bit string data.

Syntax:

string pack(string format, mixed [args]...);

Return value:

Array

PHP unpack function type:

Data processing

PHP unpack function Content Description

This function is used to decompress the bit string data. This function has exactly the same functionality and usage as the Perl function of the same name. The parameter format is the compressed format.

PHP unpack function example 1

<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> ?php  </span></span></li><li><span>$</span><span class="attribute">data</span><span> = </span><span class="attribute-value">"PHP"</span><span>;  </span></li><li class="alt"><span>print_r(unpack("C*",$data));  </span></li><li><span class="tag">?></span><span> </span></span></li></ol>

Output:

  1. Array
  2. (
  3. [1] = > 80
  4. [2] => 72
  5. [3] => 80
  6. )


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446032.htmlTechArticleWe once introduced to our friends the PHP unpack function definition to decompress bit string data. Syntax: string pack(string format, mixed [args]...); Return value: array PHP unpack function type...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn