PHP如何判断变量是不是整数

可以使用内置函数:

<?php

$val = 'abc';

echo is_int($val);