So when you said "and somebody enters, say "jkhdsjh" into the form, is_int()
returns 1" you were not really saying it as it was?
$var = "jkhdsjh";
is_int($var) should _not_ result in true. i figured you were talking about a
true bug here...
Ron
"Gareth Ardron" <[EMAIL PROTECTED]> wrote in messa
Ben Litton wrote:
>
> You could always do an is_numeric and if it returns true, cast it as an
> int.
That is the way it's meant to be done.
is_int() really checks for the dataTYPE and not the CONTENTS (of course
the contents depend on the type, e.g. in an int you won't find a string).
giving i
On Tue, 29 Nov 2005 12:53:47 -0500, "Sara Golemon" <[EMAIL PROTECTED]> wrote:
is_numeric will test if it's a numeric string. Maybe is_int should do
the same, but apparently it doesn't.
What on earth for?
If you want content, do is_numeric(). If you want type, do is_int()
Simple.
-Sa
Stefan Esser wrote:
Please move the discussion to php general mailinglist. This is a
usererror, a misunderstanding of is_int vs. is_numeric.
My bad therefore, misunderstanding of the docs as you say.
Not sure I think it's entirely sane, but feh - it's been a long day,
what do I know, etc etc.
Please move the discussion to php general mailinglist. This is a
usererror, a misunderstanding of is_int vs. is_numeric.
The documentation clearly states, that
is_numeric - Finds whether a variable is a number or a numeric string
is_int - Find whether a variable is an integer
anything within $_R
is_numeric will test if it's a numeric string. Maybe is_int should do the
same, but apparently it doesn't.
What on earth for?
If you want content, do is_numeric(). If you want type, do is_int()
Simple.
-Sara
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
Ben Litton wrote:
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.
Or use: www.php.net/ctype_digit
Ciao ciao
--
Matteo Beccati
http://phpadsnew.com
http://
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:
Ga
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, no
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 h
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.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Just out of curiosity, to which versions does this apply?
Ron
"Gareth Ardron" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> Hi.
>
> Think I've just stumbled upon a possible bug with is_int.
>
> if you've got the following code:
>
>
>
>
>
> if (!is_int($_REQUEST['days']) |
12 matches
Mail list logo