Examveda
Examveda

What will be the output of the following PHP code?
span>
function one()
{
    echo " this works";
    function two()
    {
        echo "this too works";
    }
}
one();
two();
?>

A. error

B. this works

C. this worksthis too works

D. this works this too works

Answer: Option C

Solution(By Examveda Team)

Two is declared in one and is called after one.Hence it works.

This Question Belongs to PHP >> Functions

Join The Discussion

Related Questions on Functions