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

Home » PHP » PHP Variables » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 51;
    function Result()
    {
    echo "$p";
    }
    Result();
    ?>
    1. Error
    2. 51
    3. Nothing
    4. 51 51
    5. None of these
Correct Option: C

The variable p is not defined inside the function Result(), therefore nothing is printed on the screen.



Your comments will be displayed only after manual approval.