i make cypher translator. I have an issue with translating encrypted characters ending with dots. I have following dictionary:
$dict = array(
"I"=>"1",
"L"=>"1.",
"O"=>"0",
"Q"=>"0.",
"Z"=>"2",
"?"=>"2."
);
When I use this:
function decode($cypher,$dict){
$sepp = explode(" ",$cypher);
foreach($sepp as $char){
echo array_search($char,$dict);
}}
decode("1. 0. 2.",$dict);
I am getting:
IOZ
Instead of expected:
LQ?