is_nan ???

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Can someone please explain to me how I can check (in my PHP script)
whether a user input is a number or not?

I thought it would be as simple as:

if(is_nan($myinputfield)){ then do something }

but that doesn't seem to work.

The PHP docs say that the value being passed to the is_nan function is
defined as a float_val. Wouldn't this mean then, by definition, that
it is a number? Can I pass a string to it?

I'm very confused...

Re: is_nan ???

On Sun, 07 Aug 2005 19:20:44 -0700, Martin decided we needed to hear:

Quoted text here. Click to load it

use the is_numeric() function.

(Remove REMOVE for email address)  

Re: is_nan ???


Quoted text here. Click to load it

Never mind...

I see that what I want is "is_numeric()" rather than "is_nan".

A little less confused now.

Re: is_nan ???

Quoted text here. Click to load it

Might want to have a look at the (unknown)

Met vriendelijke groeten,
Tim Van Wassenhove <

Site Timeline