"> What will be the output of the following PHP code?<?php$str;if

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

Uninitialized str is set to 0, thus if condition fails.



Your comments will be displayed only after manual approval.