Hi!
Well, technically every integer may be a float. It just depends on the context - PHP is free to cast a variable from integer to a float depending on context.
Try this to make sure is_float works okay:
print (is_float((int)10) ? "10 is a float" : "10 is not a float");
Or you can use this function:
function isfloat($st)
{
if(ereg ('[0-9]+[.,][0-9]+$',$st))
{ return(true);}
return (false);
}
print "<br><br>\n";
print (isfloat((string)10.2) ? "10.2 is a float" : "10.2 is not a float");
As you see, these work as intended,
Best regards,
Stas