Skip to content

Instantly share code, notes, and snippets.

@pedrofaria
Created June 29, 2011 21:16
Show Gist options
  • Select an option

  • Save pedrofaria/1055008 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofaria/1055008 to your computer and use it in GitHub Desktop.
<?php
$string = 'Blah';
$encoded = strtr(base64_encode(addslashes(gzcompress(serialize($string),9))), '+/=', '-_,');
$string= unserialize(gzuncompress(stripslashes(base64_decode(strtr($encoded, '-_,', '+/=')))));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment