"> 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 = 20;
    if (1)
    print "First";
    else
    print "Second";
    else
    print "Third";
    ?>
    1. Error
    2. First
    3. Second
    4. Third
    5. None of these
Correct Option: A

Hanging else statement.



Your comments will be displayed only after manual approval.