> Example
>
> 1.000,00
> 1000.00
> 1,000.00
>
> I would like to convert those to a single format
> 1000.00
<?
function money(&$money)
{
/* written by [EMAIL PROTECTED] */
$money=str_replace(array(',','.'),'',$money);
$money=substr($money,0,strlen($money)-2).'.'.substr($money,-2);
}
$money='1.000,00';
money($money);
echo $money."\n";
$money='1000.00';
money($money);
echo $money."\n";
$money='1,000.00';
money($money);
echo $money."\n";
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to