Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code ?
    <?php
    function fun($str)
    {
    echo "Hello ".$str;
    function m()
    {
    echo "\nBlock m executed...";
    }
    }
    fun("Interview Mania");
    m();
    ?>
    1. Error
    2. Hello Interview Mania
    3. Block m executed...
    4. Hello Interview Mania
      Block m executed...
    5. None of these
Correct Option: D

m is declared as fun() is executed first.



Your comments will be displayed only after manual approval.