I have a varaible $MAXwh = 299;
I am sure this and the others are right, yet the getimagesize doesn't like it, when it's dynamic.
Anyway to force the $variable to be a number or numeric even though it is?
I am sure this and the others are right, yet the getimagesize doesn't like it, when it's dynamic.

PHP Code:
// First attempt...
echo (!is_numeric($MAXwh))?"not a number"."<br />": $MAXwh."<br />";
// Result= 299
// Second attempt...
if(!is_numeric($MAXwh)){
echo "not a number";
}else{
echo $MAXwh;
}
// Result= 299
// Third attempt...
if (is_int($MAXwh)){
echo $MAXwh;
}else{
echo "not a number";
}
// Result= 299
// Last attempt...
if (is_numeric($MAXwh)){
echo $MAXwh;
}else{
echo "not a number";
}
// Result= 299

Comment