- var_dump: documentation ( source)
- base64_decode: documentation ( source)
- str_replace: documentation ( source)
- base64_encode: documentation ( source)
- str_split: documentation ( source)
<?php
function encode($str) { return str_replace(str_split('+/='), str_split('-_.'), base64_encode($str)); }
function decode($str) { return base64_decode(str_replace(str_split('-_.'), str_split('+/='), $str)); }
$str = "Now is the time for all good men to come to the aid of the party.";
var_dump($enc = encode($str), decode($enc));