Re: FILTER_SANITIZE_NUMBER_FLOAT non/sense [message #177011 is a reply to message #177010] |
Wed, 15 February 2012 22:48 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma:
|
Senior Member |
|
|
.oO(M. Strobel)
> Oh. The concept of float without fraction is new to me. I would read in an integer
> instead.
>
>> $ php -r "echo filter_var('456,999', FILTER_SANITIZE_NUMBER_FLOAT,
>> FILTER_FLAG_ALLOW_THOUSAND);"
>> 456,999
>>
>> Micha
>>
>
> Hm, it is still messed up, in the default setup it eats points and commas.
Correct. These chars are optional, hence the options. From the manual:
| FILTER_SANITIZE_NUMBER_FLOAT [...]
| Remove all characters except digits, +- and optionally .,eE.
If you need these chars, you have to use one or more options.
Micha
--
http://mfesser.de/blickwinkel
|
|
|