is_numeric will test if it's a numeric string. Maybe is_int should do the
same, but apparently it doesn't.
You could always do an is_numeric and if it returns true, cast it as an
int.
On Tue, 29 Nov 2005 12:42:10 -0500, Gareth Ardron <[EMAIL PROTECTED]>
wrote:
Matteo Beccati wrote:
Gareth Ardron wrote:
Ron Korving wrote:
Just out of curiosity, to which versions does this apply?
5.1.0b3->5.1.1 at least. Haven't got anything older to test on.
As far as I know request variables have always been strings, and
is_int() checks the variable type, not its content.
I wonder how your code was previously working ;)
It wasn't, I was just helping a mate do something. New code.
But still, it seems very odd to me - I mean, why does is_numeric()
therefore work when is_int() doesn't - that seems like strange logic to
me (though I admit I'm not the most logical of people).
I just don't see the need to have to do:
if (is_numeric($_REQUEST['var']) && is_int($_REQUEST['var'])) {
when, at least in my mind, is_int() should do the job by itself.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php