2015-12-09 12:36:30 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Created by PhpStorm.
|
|
|
|
* User: seekdasky
|
|
|
|
* Date: 09/12/15
|
|
|
|
* Time: 11:40
|
|
|
|
*/
|
|
|
|
require_once('autoloader.php');
|
|
|
|
|
2015-12-23 16:50:25 +00:00
|
|
|
// Response::quickResponse(200,'lol');
|
|
|
|
$json = [
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
],
|
|
|
|
|
|
|
|
[
|
|
|
|
"nom" => "Alex",
|
|
|
|
"prenom" => "Alex",
|
|
|
|
]
|
|
|
|
];
|
|
|
|
|
|
|
|
$compressed = compress( json_encode($json) );
|
|
|
|
$uncompressed = uncompress( $compressed );
|
|
|
|
|
|
|
|
echo $compressed.'<br><br>';
|
|
|
|
echo $uncompressed.'<br><br>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function customCompression($input, compression){
|
|
|
|
if( $compression ) return strtr(base64_encode(addslashes(gzcompress(serialize($input),9))), '+/=', '-_,');
|
|
|
|
else return unserialize(gzuncompress(stripslashes(base64_decode(strtr($input, '-_,', '+/=')))));
|
|
|
|
}
|
|
|
|
|
|
|
|
function uncompress($input){
|
|
|
|
|
|
|
|
}
|