Convert full-width numbers to half-width numbers
function Getalabnum ($fnum) {
$nums = Array (' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', '. ', '-', ' + ', ': ');
$fnums = Array (' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', '. ', '-', ' + ', ': ');
$fnlen = count ($fnums);
for ($i =0; $i < $fnlen; $i + +) $fnum = Str_replace ($nums [$i], $fnums [$i], $fnum);
$slen = strlen ($fnum);
$oknum = ";
for ($i =0; $i < $slen; $i + +) {
if (Ord ($fnum [$i]) > 0x80) $i + +;
else $oknum. = $fnum [$i];
}
if ($oknum = = "") $oknum = 0;
return $oknum;
}
http://www.bkjia.com/PHPjc/318569.html www.bkjia.com true http://www.bkjia.com/PHPjc/318569.html techarticle //Convert full-width numbers to half-width digital functiongetalabnum ($fnum) {$nums =array (' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', '. ', '-', ' + ', ': '); $fnums =array (' 0 ', ' 1 ' ...