"/>
Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

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

    <?php

    function mine($num)

    {

    $num = 2 + $num;

    echo "$num";

    }

    mine(3);

    ?>

  2. A.

     3

    B.

     $num

    C.

     5

    D.

     None of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    The function is defined as echo “$num”.This means $num is treated as a string and not as a variable.


Be The First To Comment