-
What will be the output of the following PHP code ?
<?php
function fun($str)
{
if ($str < 50)
return 30;
else
return 60;
}
$p = fun(100);
if ($p < 30)
{
echo "Hello!";
}
else
{
echo "Hey!";
}
?>
-
- Error
- Hello!
- Hey!
- Hello!
Hey! - None of these
Correct Option: C
Function returns 60. this is greater than 30, hence the output.