[thelist] PHP - strings and integers

Chris Blessing webguy at mail.rit.edu
Mon Apr 8 10:29:01 CDT 2002


You could use this and redirect based on the result:

http://www.php.net/manual/en/function.is-numeric.php

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> I'm currently trying to test if a year passed as part of a query
> string is a
> numeral or not. I am using urls with slashes instead of a query
> string, and
> breaking it up in php, so it comes originally as a string. This presents a
> problem, because I can't test to see if the number passed for a year is a
> numeral or not, since it came as a string. I can't just convert
> it across to
> be a numeral - I want to give an error page on incorrect values
> entered. How
> can I test to see if it really is a number?
>
> Thanks
>
> Lach




More information about the thelist mailing list