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");
?>
<?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.Related Questions on PHP Filter
A. Only 2
B. 2 and 3
C. None of the mentioned
D. All of the mentioned
A. filter_var_array()
B. filter_var()
C. filter_input
D. filter_input_array
A. No output is returned
B. Integer is not valid
C. Integer is valid
D. Error
Join The Discussion