note 27554 deleted from function.is-numeric by cmb
| From: | cmb@php.net | Date: | Sun, 23 Jun 2019 10:30:44 +0000 |
| Subject: | note 27554 deleted from function.is-numeric by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211341@lists.php.net to get a copy of this message | ||
Note Submitter: redy dot r at madagascan dot com
----
Be aware if you use is_numeric() or is_float() after using set_locale(LC_ALL,'lang') or
set_locale(LC_NUMERIC,'lang')
Example :
If at the beginning of your script, you declare :
<?php
set_locale(LC_NUMERIC,'fr');
?>
and after, you will get this :
<?php
is_numeric(12.25); // Return False
is_numeric(12,25); // Return True
is_float(12.25); //Return False
is_float(12,25); //Return True
?>
Because, for french language the decimal separator is ',' (Comma) instead of '.'
(Dot).