WP_Http_Encoding::compress( string $raw, int $level = 9, string $supports = null ): string|false

In this article

Compress raw string using the deflate format.

Description

Supports the RFC 1951 standard.

Parameters

$rawstringrequired
String to compress.
$levelintoptional
Compression level, 9 is highest.

Default:9

$supportsstringoptional
Not used. When implemented it will choose the right compression based on what the server supports.

Default:null

Return

string|false Compressed string on success, false on failure.

Source

public static function compress( $raw, $level = 9, $supports = null ) {
	return gzdeflate( $raw, $level );
}

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.