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

++$p increments a and then prints it,$p++ prints and then increments.



Your comments will be displayed only after manual approval.