PHP Source:
<!DOCTYPE html>
<html>
<body>

<?php
// Variable to check
$int = 0;

if (filter_var($int, FILTER_VALIDATE_INT) === 0 || !filter_var($int, FILTER_VALIDATE_INT) === false) {
    echo("Variable is an integer");
} else {
    echo("Variable is not an integer");
}
?>


</body>
</html>
Result:
Show PHP - © w3schools.com
Privacy Policy