- base64_decode: documentation ( source)
- trim: documentation ( source)
- base64_encode: documentation ( source)
- range: documentation ( source)
<?php
foreach (range(1,1000) as $int) {
echo "{$int}: TRIMMED:" . (base64_decode(trim('=', base64_encode($int))) === $int ? 'Pass' : 'Fail') .
" UNTRIMMED: " (base64_decode(base64_encode($int)) === $int ? 'Pass' : 'Fail') .
"\n";
}