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

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

// Min value
$min = 1;
// Max value
$max = 200;

if (filter_var($int, FILTER_VALIDATE_INT, array("options" => array("min_range"=>$min, "max_range"=>$max))) === false) {
    echo("Variable value is not within the legal range");
} else {
    echo("Variable value is within the legal range");
}
?>


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