Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    <?php
    function First()
    {
    echo "Function First executed...\n";
    function Second()
    {
    echo "Function Second executed...";
    }
    }
    First();
    Second();
    ?>
    1. Function First executed...
    2. Function Second executed...
      Function First executed...
    3. Function Second executed...
    4. Function First executed...
      Function Second executed...
    5. None of these
Correct Option: D

Second is declared in First and is called after First.Hence it works.



Your comments will be displayed only after manual approval.