Examveda
Examveda

What will be the output of the following PHP code?
<?php
$num = "123";
if (!filter_var($num, FILTER_VALIDATE_INT))
    echo("Integer is not valid");
else
    echo("Integer is valid");
?>

A. No output is returned

B. Integer is not valid

C. Integer is valid

D. Error

Answer: Option C

Solution(By Examveda Team)

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

This Question Belongs to PHP >> PHP Filter

Join The Discussion

Related Questions on PHP Filter