ayman - 2014-07-09 08:59:10
Dear I change it to make it as function
<?php
function English2ArabicNumber($myText)
{ $digit = (string)$myText;
if(empty($digit))
return '٠';
$ar_digit = array('٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩','-'=>'-','.'=>',');
$arabic_digit = '';
$length = strlen($digit);
for($i=0;$i<$length;$i++){
if(isset($ar_digit[$digit[$i]]))
$arabic_digit .= $ar_digit[$digit[$i]];}
return $arabic_digit;}
?>
<?php
$myNum=5558.58;
echo English2ArabicNumber($myNum);
?>