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

Home » PHP » PHP Variables » Question
  1. What will be the output of the following PHP code ?
    <?php
    $n = 10;
    {
    $n = 20;
    echo "$n";
    }
    echo "$n";
    ?>
    1. 10
    2. Error
    3. 20
    4. 2020
    5. None of these
Correct Option: D

Variable n stores the value 20 and not 10.



Your comments will be displayed only after manual approval.