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

Home » PHP » PHP Operators » Question
  1. What will be the output of the following PHP code ?
    <?php
    $num1 = 5;
    $num2 = 5;
    if ($Res = (($num1 == 5) && ($num2 != 0)))
    {
    print "Result is $Res";
    }
    ?>
    1. 5
    2. true
    3. 0
    4. Result is 1
    5. None of these
Correct Option: D

Result is num1 && num2 which returns 1 if both num1 and num2 are true.



Your comments will be displayed only after manual approval.