Re: Only numbers
| From: | CPT John W. Holmes | Date: | Thu, 15 May 2003 18:43:48 +0000 |
| Subject: | Re: Only numbers | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147767@lists.php.net to get a copy of this message | ||
> From: "Kevin Stone" <kevin@helpelf.com>
> > From: "Ryan A" <ryan@jumac.com>
> >
> > I have a form that has $phone_number, i dont want "89888-23323" or
> > "asdfasdf" there....only numbers...
> > what to do?
>
> is_int()
> http://www.php.net/manual/en/function.is-int.php
is_int() will fail for form data because it is really a string. is_numeric()
is usually a better choice, but be aware that it will approve numbers such
as -123.45E6.
---John Holmes...