Home » PHP » PHP Filters Advanced » Question
  1. What will be the output of the following PHP code?
    <?php
    $n = "102030";
    if (!filter_var($n, FILTER_VALIDATE_INT))
    echo("Given Integer is not valid");
    else
    echo("Above Integer is valid");
    ?>
    1. Error
    2. Nothing
    3. Given Integer is valid
    4. Given Integer is not valid
    5. None of these
Correct Option: C

filter_var() – Filters a single variable with a specified filter.



Your comments will be displayed only after manual approval.