Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    <?php
    function calculate($p, $t="")
    {
    $total = $p + ($p * $t);
    echo "$total";
    }
    calculate(65);
    ?>
    1. Nothing
    2. Error
    3. 56
    4. 65
    5. None of these
Correct Option: D

You can designate certain arguments as optional by placing them at the end of the list and assigning them a default value of nothing.



Your comments will be displayed only after manual approval.