-
What will be the output of the following PHP code?
<?php
$n=256;
$int_opt = array("opt"=>array ("min"=>0, "max"=>256));
if (!filter_var($n, FILTER_VALIDATE_INT, $int_opt))
echo("Given Integer is not valid");
else
echo("Given Integer is valid");
?>
-
- Given Integer is valid
- Error
- Given Integer is not valid
- Nothing
- None of these
Correct Option: A
Since the integer is “256” it is in the specified range, and the output of the code above will be: “Given Integer is valid”.