(1)用is_numeric()函数判断是否为数字或数字字符串;

(2)用strpos()判断数字中是否含有小数点;

if(!is_numeric($age)||strpos($age,".")!==false){
echo "不是整数";
}else{
echo "是整数";
}