|
Posted by Rik on 02/08/07 19:01
One <david.hunter@gmail.com> wrote:
> Input :
> echo "history['order_total'] is ".$history['order_total']."<br />";
> $removeit=3Dstr_replace('$' ,'', $history['order_total']);
> echo $removeit;
> $floatandremove =3D floatval($removeit);
> echo "<br />floatandremove is ".$floatandremove;
> exit;
>
> Output :
> history['order_total'] is $241.47
> 241.47
> floatandremove is 0
>
There must be something else going on with your currency string.
Please use this on that string, and report it's results back to us:
echo preg_replace('/(.)/se','"[".ord("$1")."]"',$history['order_total'])=
;
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|