|
Posted by One on 02/08/07 19:45
On Feb 8, 2:01 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> One <david.hun...@gmail.com> wrote:
> > Input :
> > echo "history['order_total'] is ".$history['order_total']."<br />";
> > $removeit=str_replace('$' ,'', $history['order_total']);
> > echo $removeit;
> > $floatandremove = 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
Thanks again Rik - here you go :
Input :
echo "history['order_total'] is ".$history['order_total']."<br />";
echo preg_replace('/(.)/se','"[".ord("$1")."]"',
$history['order_total']);
exit;
Output :
history['order_total'] is $241.47
[60][98][62][36][50][52][49][46][52][55][60][47][98][62]
Navigation:
[Reply to this message]
|