Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

  1. What will be the output of the following PHP code ?

    <?php

    function TV($string)

    {

    echo "my favourite TV show is ".$string;

    function b()

    {

    echo " I am here to spoil this code";

    }

    }

    function b()

    {

    echo " I am here to spoil this code";

    }

    b();

    ?>

  2. A.

     I am here to spoil this code

    B.

     Error

    C.

     my favourite TV show isI am here to spoil this code

    D.

     None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    This one works because b is declared independent of TV() also.


Be The First To Comment