Tango.info base20: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
consonants only, omitting "l" | |||
<pre> | <pre> | ||
function tif_num2consonants($number, $frombase=10 , $tobase=20){ | function tif_num2consonants($number, $frombase=10 , $tobase=20){ |
Revision as of 2011-06-10T02:09:08
consonants only, omitting "l"
function tif_num2consonants($number, $frombase=10 , $tobase=20){ //convert to base 20 $r=base_convert ($number, $frombase , $tobase ); //convert 0-j to b-z, no vowel, no l $char_0j_to_bz=array( 0=>"b", 1=>"c", 2=>"d", 3=>"f", 4=>"g", 5=>"h", 6=>"j", 7=>"k", 8=>"m", 9=>"n", "a"=>"p", "b"=>"q", "c"=>"r", "d"=>"s", "e"=>"t", "f"=>"v", "g"=>"w", "h"=>"x", "i"=>"y", "j"=>"z" ); $r=str_split($r); $r_new=array(); foreach ($r as $k =>$v){ $v_new=$char_0j_to_bz[$v]; $r_new[$k]=$v_new; } $r_new=implode($r_new); //$tmp=array_flip($tmp); return $r_new; }