[thelist] PHP is_nan

Keith Dahlby dahlbyk at softhome.net
Wed Jul 2 15:59:12 CDT 2003


Francis,

 From the PHP documentation:
bool is_nan ( float val)
Returns TRUE if val is 'not a number', like the result of acos(1.01).

Try this instead:
bool is_numeric ( mixed var)
Returns TRUE if var is a number or a numeric string, FALSE otherwise.

HTH!
Cheers ~ K

At 01:43 PM 7/2/2003, you wrote:
><?
>$tester = "hello";
>
>if (is_nan($tester))
>
>         {
>         echo "this works";
>         exit;
>         }
>
>else
>
>         {
>         echo "don't work";
>         exit;
>         }
>?>
>
>And I get back:
>
>Warning: is_nan() expects parameter 1 to be double, string given in
>(address of the page)



More information about the thelist mailing list