PHP Classes

PHP RLE Compression Algorithm: Compress and decompress data using RLE in pure PHP

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 234 This week: 1All time: 8,107 This week: 68Up
Version License PHP version Categories
rle 0.1Free for non-comm...5.0PHP 5, Compression


This class can compress and decompress data using RLE in pure PHP.

It can take a string of data and compress it with the Run Length Encoding algorithm.

The class can also do the opposite, i.e. decode previously compressed data with the same algorithm.

Innovation Award
PHP Programming Innovation award nominee
December 2014
Number 5

Prize: One copy of the Zend Studio
RLE (Run-Level Encoding) is a simple compression algorithm that compresses data that has many repeated symbols.

This class provides a pure PHP implementation of the REL compression algorith to compress and decompress data.

Manuel Lemos
Picture of Chi H.
  Performance   Level  
Name: Chi H. <contact>
Classes: 28 packages by
Country: France France
Age: 39
All time rank: 34122 in France France
Week rank: 20 Up2 in France France Up
Innovation award
Innovation award
Nominee: 22x

Winner: 3x


* Copyright (c) 2014 Chi Hoang
* All rights reserved

$obj = new Compress\Rle("aaaabbcc","Encode");

$obj = new Compress\Rle("a4b2c2","Decode");

$obj = new Compress\Rle("aabb","Decode");

$obj = new Compress\Rle("aabbccde","Encode");

$obj = new Compress\Rle("aabbccdeaaaaaaaaaaaaaaae","Encode");


  Files folder image Files  
File Role Description
Accessible without login Plain text file compressTest.php Test Unit Test
Accessible without login Plain text file example.php Example example script
Plain text file main.php Class main class

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:8,107
This week:68Up