evaluating whether a string value is an integer
| From: | Aaron Peterson | Date: | Sat, 23 Mar 2002 17:53:13 +0000 |
| Subject: | evaluating whether a string value is an integer | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-81673@lists.php.net to get a copy of this message | ||
I am just learning php to put to use on building ecommerce sites. I bought
a book yesterday to help me on my quest, but it comes up a little short on
error handling. From what I understand, any data passed to a php script
from an HTML form is of type string. I have managed to make sure people can
only order a real number of items (can't enter text when I expect a value)
by using the is_numeric() function. However, this does not ensure that
people can't order 1.7777777777 hard disks or something silly like that.
how do I evaluate a string variable (since I seem not to have other options)
to make sure it is of type integer rather than type double?
Aaron