ExamVeda
Login
Home
This question belongs to PHP PHP Filter
PHP Filter
?

What will be the output of the following PHP code?
<?php
$var=300;
$int_options = array("options"=>array ("min_range"=>0, "max_range"=>256));
if (!filter_var($var, FILTER_VALIDATE_INT, $int_options))
    echo("Integer is not valid");
else
    echo("Integer is valid");
?>

Answer & Solution
Correct Answer: Option B
Since the integer is “300” it is not in the specified range, and the output of the code above will be: “Integer is not valid”.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.