I have been trying to implement the is_nan() function into a simple php file, but without success. Here is the code that I've been using.
<?php
$var1 = 'hey';
if(is_NaN($var1)) {
echo 'its not a number';
}
else {
echo 'its a number';
}
?>
it works when $var1 is a number, becasue it says 'its a number', but when $var1 is equal to a string, as it is now, the code doesnt output correctly. It gives an error:
Warning: is_nan() expects parameter 1 to be double, string given in /home/ashatay/public_html/shimnet/phphome/math2.php on line 14.
Can someone please help me?
thanks in advance,
shimano55