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

Home » PHP » PHP If Else/Else If Statement » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = "0";
    $q = "1";
    if ((int)$p && $q)
    print"Interview";
    else
    print "Mania";
    ?>
    1. Mania
    2. Interview
    3. true
    4. false
    5. None of these
Correct Option: A

The expression is evaluated with values contained in the string, even without typecasting.



Your comments will be displayed only after manual approval.