<?php
$not_an_int = "sa';';';'sd12340asd";
$actual_int = "12341234";
var_dump(is_int((int)$not_an_int));
echo "<br />";
var_dump(is_int((int)$actual_int));
echo "<br />";
echo "<br />";
var_dump(is_int($not_an_int));
echo "<br />";
var_dump(is_int($actual_int));
?>
Returns:
true
true
false
false
Without casting, real integer is seen as false.
With casting, a non-integer is seen as true.
What would be a real method to detect both "2139481" and 29481932 as integers?