?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$x = 5;
function fun()
{
echo "$x";
}
fun();
?>
<?php
$x = 5;
function fun()
{
echo "$x";
}
fun();
?>
Answer & Solution
Correct Answer:
Option
C
The variable x is not defined inside the function fun(), therefore nothing is printed on the screen.
Join the Discussion
Login to post a comment or share your explanation.
Login