?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
function sayHello()
{
echo "HelloWorld<br />";
}
$function_holder = "sayHello";
$function_holder();
?>
<?php
function sayHello()
{
echo "HelloWorld<br />";
}
$function_holder = "sayHello";
$function_holder();
?>
Answer & Solution
Correct Answer:
Option
D
It is possible to assign function names as strings to variables and then treat these variables exactly as you would the function name itself.
Join the Discussion
Login to post a comment or share your explanation.
Login