Home » PHP » PHP Operators » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 20; $q = 20;
    if ($p = 12)
    $q--;
    echo $p;
    echo $q--;
    ?>
    1. 12
    2. Error
    3. Nothing
    4. 1219
    5. None of these
Correct Option: D

p is set to 20 in the if condition and q is post decremented in the print statement.



Your comments will be displayed only after manual approval.