- var_dump: documentation ( source)
- bin2hex: documentation ( source)
- base64_decode: documentation ( source)
- base64_encode: documentation ( source)
<?php
function analyze(string $input): bool
{
$decoded = base64_decode($input);
var_dump(bin2hex($decoded));
return base64_encode($decoded) === $input;
}
var_dump(analyze('PHP'));
var_dump(analyze('PHP='));
var_dump(analyze('PHM='));