Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    <?php
    function n()
    {
    function m()
    {
    echo 'M';
    }
    echo 'N';
    }
    m();
    n();
    ?>
    1. Nothing
    2. Error
    3. M
    4. N
    5. None of these
Correct Option: B

This will be the output- Fatal error: Call to undefined function m(). You cannot call a function which is inside a function without calling the outside function.



Your comments will be displayed only after manual approval.