PHP MCQs | What will be the output of the following code?

$var = 10;
function fn ()
{
$var = 20;
return $var;
}
fn ();
echo $var;
a. 10
b. 20
c. Undefined Variable
d. Syntax Error
Ans: a

0 comments:

Post a Comment

Blogger news