-
What will be the output of the following PHP code?
<?php
function fun1()
{
function fun2()
{
echo 'I am Ajit.';
}
echo 'I am Rahul';
}
fun2();
fun1();
?>
-
- Error
- I am Ajit.
- I am Rahul.
- I am Rahul. I am Ajit.
- None of these
Correct Option: A
This will be the output- Fatal error: Call to undefined function fun2(). You cannot call a function which is inside a function without calling the outside function.