"> 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 = 20;
    if ($p = $p&0)
    print $p ;
    else
    print "Executed...";
    ?>
    1. Error
    2. Nothing
    3. 20
    4. Executed...
    5. None of these
Correct Option: D

p&0 is 0,thus evaluated to false.



Your comments will be displayed only after manual approval.