Horje Website
PHP Function with Parameters – Learn Function with parameters – PHP Code

PHP Function with Parameters – Learn Function with parameters

PHP Function with Parameters - Learn Function with parameters - PHP Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>PHP Function with Parameters</title>
  5. </head>
  6. <body>
  7. <?php
  8. // Defining function
  9. function getSum($num1, $num2){
  10. $sum = $num1 + $num2;
  11. echo "Sum of the two numbers $num1 and $num2 is : $sum";
  12. }
  13. // Calling function
  14. getSum(10, 20);
  15. ?>
  16. </body>
  17. </html>



Try Your Self ->



Published:
September 25, 2020
Author:
admin
Category:
PHP Basic, PHP Source Code
Views:
22

This article was posted in PHP Basic, PHP Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2023