"> What will be the output of the following PHP code ?<?phpfunction

Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code ?
    <?php
    function Example($d)
    {
    $d = 12 + $d;
    echo "$d";
    }
    Example(6);
    ?>
    1. 12
    2. 6
    3. 18
    4. $d
    5. None of these
Correct Option: D

The function is defined as echo “$d”. This means $d is treated as a string and not as a variable.



Your comments will be displayed only after manual approval.