Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    <?php
    function Add($p, $q)
    {
    $r = $p + $q;
    return $r;
    }
    echo "6 + 20 = " . Add(8,23) . "\n";
    echo "8 + 23 = " . Add(3,24) . "\n";
    echo "3 + 24 = " . Add(6,20);
    ?>
    1. 6 + 20 = 31
      8 + 23 = 27
    2. Error
    3. 3 + 24 = 26
    4. 6 + 20 = 26
      8 + 23 = 31
      3 + 24 = 27
    5. 6 + 20 = 31
      8 + 23 = 27
      3 + 24 = 26
Correct Option: E

The function calls are jumbled.



Your comments will be displayed only after manual approval.