PHP/String/strval
Checking for an integer
if ($_POST["age"] != strval(intval($_POST["age"])) {
$errors[] = "Please enter a valid age.";
}
Validating an integer with typecasting
<?php
if ($_POST["rating"] != strval(intval($_POST["rating"]))) {
print "Your rating must be an integer.";
}
?>