Discussion :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
function start($string)
{
if ($string < 45)
return 20;
else
return 40;
}
$t = start(90);
if ($t < 20)
{
echo "Have a good day!";
}
else
{
echo "Have a good night!";
}
?>
Answer : Option B
Explanation :
Function returns 40. this is greater than 20, hence the output.
Be The First To Comment