Function that returns a value


SUBMITTED BY: henry1874w

DATE: June 17, 2017, 1:05 p.m.

FORMAT: Text only

SIZE: 237 Bytes

HITS: 336

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5. function sum($x, $y) {
  6. $z = $x + $y;
  7. return $z;
  8. }
  9. echo "5 + 10 = " . sum(5,10) . "<br>";
  10. echo "7 + 13 = " . sum(7,13) . "<br>";
  11. echo "2 + 4 = " . sum(2,4);
  12. ?>
  13. </body>
  14. </html>

comments powered by Disqus