Altrimenti potresti sfruttare anche la preg_match

Codice PHP:
$pattern "/^([0-9]+)$/";
if(
preg_match($pattern,$string)) {
echo 
'intero';
} else {
echo 
'non intero';

oppure proprio la funzione is_numeric

Codice PHP:
function isInt ($x=0){
return (
is_numeric($x) ? intval($x) == $x false);
}
if(
isInt($var) {
echo 
'intero';
} else {
echo 
'non intero';