Single Choice Not Set

QWhat will be the output of the following PHP code?
< ?php 
    function foo($msg)
    {
        echo "$msg";
    }
    $var1 = "foo";
    $var1("will this work");
?>

ID: #2436 Functions in PHP MCQ 933 views
Question Info
#2436Q ID
Not SetDifficulty
Functions in PHP MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Error
  • B $msg
  • D will this work
Correct Answer

Explanation

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

Share This Question

Challenge a friend or share with your study group.