对字符串‘123456’进行后端加密,前端js可解密出真实字符
测试代码php:
static $hashMap = array( '0' => '4', '1' => '9', '2' => '1', '3' => '7', '4' => '2', '5' => '8', '6' => '3', '7' => '6', '8' => '5', '9' => '0', ); print_r(array_keys($hashMap));echo '==1=='; print_r(array_values($hashMap));echo '==2=='; $a = '123456'; echo str_replace(array_keys($hashMap), array_values($hashMap), $a);