I have this PHP code:
$entityElementCount = (-($highScore-$totalKeywordCount))/0.29;
What i want to know is, how to check whether $
I always use typecasting to check if variables contain a whole number, handy when you don't know the origin or type of the value.
if ((string) $var === (string) (int) $var) {
echo 'whole number';
} else {
echo 'whatever it is, it\'s something else';
}
In your particular case, I would use is_int()
if (is_int($var) {
echo 'integer';
}