Re: evaluating whether a string value is an integer
| From: | Rasmus Lerdorf | Date: | Sat, 23 Mar 2002 19:06:00 +0000 |
| Subject: | Re: evaluating whether a string value is an integer | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-81675@lists.php.net to get a copy of this message | ||
(int)$value;
On Sat, 23 Mar 2002, Aaron Peterson wrote:
> 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
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>