I am trying to check in php if a string is a double or not.
Here is my code:
if(floatval($num)){
$this->print_half_star();
}
$num is a string..The problem is that even when there is an int it gives true. Is there a way to check if it is a float and not an int!?
1 Answer