Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function decode(string $code): string {
- $decode = "";
- foreach (explode(" ", str_replace(" ", " ._. ", $code)) as $ms) {
- $decode .= array_search($ms, [" " => "._.",";"=>"-.-.-.","="=>"-...-","O"=>"---","9"=>"----.","/"=>"-..-.","&"=>".-...","3"=>"...--","W"=>".--","M"=>"--","Z"=>"--..","'"=>".----.","!"=>"-.-.--","B"=>"-...","U"=>"..-","1"=>".----",")"=>"-.--.-","A"=>".-","-"=>"-....-","V"=>"...-","SOS"=>"...---...","Y"=>"-.--","I"=>"..","Q"=>"--.-","N"=>"-.","2"=>"..---","6"=>"-....",","=>"---...","+"=>".-.-.","@"=>".--.-.","4"=>"....-","0"=>"-----","."=>".-.-.-","C"=>"-.-.","E"=>".","F"=>"..-.","J"=>".---","K"=>"-.-","L"=>".-..","R"=>".-.","S"=>"...","G"=>"--.","8"=>"---..","?"=>"..--..","("=>"-.--.","P"=>".--.","5"=>".....","_"=>"..--.-","D"=>"-..","\\"=>".-..-.","T"=>"-","H"=>"....",","=>"--..--","$"=>"...-..-","7"=>"--...","X"=>"-..-"]);
- }
- return $decode;
- }
- //".... . -.-- .--- ..- -.. ." = HEY JUDE
- echo decode(".... . -.-- .--- ..- -.. .");
- //codewars.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement