[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: arabic numbering in php?
- To: "Development Discussions" <developer at arabeyes dot org>
- Subject: Re: arabic numbering in php?
- From: ahmed at piousity dot net
- Date: Sun, 6 Nov 2005 00:15:36 -0600 (CST)
- Importance: Normal
- User-agent: SquirrelMail/1.4.4
cool, that worked, jazakAllah khair. for the purpose of sharing,
here's what i did:
<?php
function arabize($num){
$start = strlen('' . $num);
$val = pow(10, $start-1);
$result = "";
while ($val > 1){
$result = $result . arabizeDigit((int)($num / $val));
$num = $num % $val;
$val = $val / 10;
}
$result = $result . arabizeDigit($num);
return $result;
}
function arabizeDigit($num){
$val = 660 + $num;
return "&#x$val;";
}
echo arabize(1);
?>