or value or by using the function intval() or floatval() <?php $a = 123; echo "is_int($a) = " . (is_int($a) ? "true" : "false") . "\n"; $a = '123'; echo "is_int((int)$a) = " . (is_int((int)$a) ? "true" : "false") . "\n"; ?>