note 27554 added to function.is-numeric
| From: | redy dot r at madagascan dot com | Date: | Tue, 10 Dec 2002 22:54:24 +0000 |
| Subject: | note 27554 added to function.is-numeric | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40676@lists.php.net to get a copy of this message | ||
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).
--
http://www.php.net/manual/en/function.is-numeric.php
http://master.php.net/manage/user-notes.php?action=edit+27554
http://master.php.net/manage/user-notes.php?action=delete+27554
http://master.php.net/manage/user-notes.php?action=reject+27554