摩斯电码加密解密demo
摩斯电码加密:
$txt = ''//需要加密的字符 $morse = Morse::encode($txt);
摩斯电码解密:
$morse = ''//需要解密的摩斯电码 $morse = Morse::decode($morse);
实例如下:
$txt = '测试'; $morse = Morse::encode($txt); echo $morse . "<br/>"; $txt = Morse::decode($morse); echo $txt;
输入结果如下:
–.–.-.-..-.–/-…-.—-.-.-.-