PHP Classes

Thanks for nice clean class

Recommend this page to a friend!

      English to Arabic Number  >  All threads  >  Thanks for nice clean class  >  (Un) Subscribe thread alerts  
Subject:Thanks for nice clean class
Summary:I like it with this changes
Messages:1
Author:ayman
Date:2014-07-09 08:59:10
 

  1. Thanks for nice clean class   Reply   Report abuse  
Picture of ayman 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 '&#1632;';
$ar_digit = array('&#1632;', '&#1633;', '&#1634;', '&#1635;', '&#1636;', '&#1637;', '&#1638;', '&#1639;', '&#1640;', '&#1641;','-'=>'-','.'=>',');
$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);
?>