adplus-dvertising
frame-decoration

Question

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!";
}
?>

a.

Have a good day!

b.

Have a good night!

c.

ERROR

d.

None of the mentioned

Posted under Functions in PHP PHP

Answer: (b).Have a good night!

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code ?

Similar Questions

Discover Related MCQs