Forum Moderators: coopster
If I have a 10 digit string and just want to temporarily mask it and then (using the masked value) get the original back, which is the best function/approach?
There are no security issues, I just need to change a string, pass it around the site a bit (in a url) and then change it back again...
Many thanks, hope that's not too confusing heh!
Nick
function obfuscate($input)
{
$output = "";
$j = strlen($input);
for($i=0;$i<$j;$i++)
{
$output .= chr(ord(substr($input,$i,1)) ^ 0x02);
}
return $output;
}
Just call it twice to return to the original string...