note 41895 added to function.floatval
| From: | php-general at lists dot php dot net | Date: | Sun, 25 Apr 2004 06:25:44 +0000 |
| Subject: | note 41895 added to function.floatval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68756@lists.php.net to get a copy of this message | ||
i have a question...
so far all the examples just converts something into a float;
-casting anything into a float (float)$something
-functions to take $something and get only numbers
however if you wanted to convert string into a float without modifcation to initial data, how would
you do it? Like in java, you can use class libraries to convert string to float.
if the string were: 93843string.here, it will display a error msg, because it can not be converted
instead of just getting string value.
can we do something like that in php?
i want to use it for form, to check the input; if it is not correct input then return 1; etc
----
Manual Page -- http://www.php.net/manual/en/function.floatval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41895
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41895&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41895&report=yes
Search -- http://master.php.net/manage/user-notes.php