My apologies for assuming too much of the variable names. Thank you for
correcting me.
Your response has caused me good confusion though. If I remove the ${...}
notation I get quite a different output (specifically, there's no output).
Are you sure the parser ignores it?
This is the code I sug
I'm sorry to jump in mid-stream here (I've been offline for a while), but
was
$constant_value=${constant_name};
suggested?
eval's spook me, so I would prefer this solution over the working
suggestion you received.
This works for me on 4.0.4:
$test_name="ta_dah";
define("constant_name","test_nam
preg_replace("/0+$/","",$number);
On Thu, 25 Jan 2001, Ethan Nelson wrote:
> Almost there... actually this creates one problem...
>
> It turns 40.00 into 4
>
> It needs to quit shaving zero's when it hits the decimal point.
>
> 40.00 into 40
> 45.50 into 45.5
> 40.25 into 40.25
>
> Thanks
>
> --
This might help.
$no_trailing_zeroes = preg_replace("/0+$/","",$trailing_zeroes);
> Dear friends,
>
> I am accessing MySQL database using apache and php.
> I have to display a double integer field without trailing zeros.
> The number of digits after the decimal point varies.
>
> I have tried se
4 matches
Mail list logo