[thelist] PHP - strings and integers

Lachlan Cannon luminosity at members.evolt.org
Mon Apr 8 10:23:34 CDT 2002


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

<tip author="Lachlan" type="PHP">
A 'stable' version of PHP-GTK has been released and can be downloaded at
http://gtk.php.net . PHP-GTK can be used to make cross platform GUI
applications using PHP.
</tip>





More information about the thelist mailing list