Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    function fun($msg)
    {
    echo "$msg";
    }
    $var = "fun";
    $var("This will execute...");
    ?>
    1. $msg
    2. This will execute...
    3. Error
    4. 0
    5. None of these
Correct Option: B

It is possible to call a function using a variable which stores the function name.



Your comments will be displayed only after manual approval.