gzdeflate Deflate a string php函数


gzdeflate

(PHP 4 >= 4.0.4, PHP 5)

gzdeflateDeflate a string

说明

string gzdeflate ( string $data [, int $level = -1 ] )

This function compress the given string using the DEFLATE data format.

For details on the DEFLATE compression algorithm see the document "» DEFLATE Compressed Data Format Specification version 1.3" (RFC 1951).

参数

data

The data to deflate.

level

The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. If not given, the default compression level will be the default compression level of the zlib library.

返回值

The deflated string or FALSE if an error occurred.

范例

Example #1 gzdeflate() example

<?php
$compressed 
gzdeflate('Compress me'9);
echo 
$compressed;
?>

参见



相关阅读:
gzencode Create a gzip compressed string
gzeof Test for EOF on a gz-file pointer
gzfile Read entire gz-file into an array
gzgetc Get character from gz-file pointer
gzgets Get line from file pointer
gzgetss Get line from gz-file pointer and strip HTML tags
gzinflate Inflate a deflated string
gzopen Open gz-file
gzpassthru Output all remaining data on a gz-file pointer
gzputs 别名 gzwrite
gzread Binary-safe gz-file read
gzrewind Rewind the position of a gz-file pointer
gzseek Seek on a gz-file pointer
gztell Tell gz-file pointer read/write position
快速导航

Copyright © 2016 phpStudy |