"> What will be the output of the following PHP code ?<?php$num

Home » PHP » PHP If Else/Else If Statement » Question
  1. What will be the output of the following PHP code ?
    <?php
    $num = "";
    if ($num)
    print "Second";
    else
    print "First";
    ?>
    1. True
    2. Second
    3. First
    4. False
    5. None of these
Correct Option: C

Empty string is evaluated to 0.



Your comments will be displayed only after manual approval.