function num_2_a( $tel ){ |
$a = str_replace ( '0' , 'z' , $tel ); |
$a = str_replace ( '1' , 'b' , $a ); |
$a = str_replace ( '2' , 'y' , $a ); |
$a = str_replace ( '3' , 'd' , $a ); |
$a = str_replace ( '4' , 'e' , $a ); |
$a = str_replace ( '5' , 'u' , $a ); |
$a = str_replace ( '6' , 'g' , $a ); |
$a = str_replace ( '7' , 'h' , $a ); |
$a = str_replace ( '8' , 'i' , $a ); |
$a = str_replace ( '9' , 'k' , $a ); |
} |
function a_2_num( $str ){ |
$a = str_replace ( 'z' , '0' , $str ); |
$a = str_replace ( 'b' , '1' , $a ); |
$a = str_replace ( 'y' , '2' , $a ); |
$a = str_replace ( 'd' , '3' , $a ); |
$a = str_replace ( 'e' , '4' , $a ); |
$a = str_replace ( 'u' , '5' , $a ); |
$a = str_replace ( 'g' , '6' , $a ); |
$a = str_replace ( 'h' , '7' , $a ); |
$a = str_replace ( 'i' , '8' , $a ); |
$a = str_replace ( 'k' , '9' , $a ); |
} |
初级程序员
by: 逆时针 发表于:2016-06-30 11:52:58 顶(0) | 踩(0) 回复
$search
=
array
(0,1,2,3,4,5,6,7,8,9);
$replace
=
array
(
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'g'
,
'h'
,
'i'
,
'j'
);
$a
=
str_replace
(
$search
,
$replace
,
$a
);
回复评论