Write the Syntax to define Function in PHP.
Answers
Answered by
1
php // add function with 2 arguments function add($a, $b) { $sum = $a + $b; // returning the result return $sum; } // overloaded add function with 3 arguments function add($a, $b, $c) { $sum = $a + $b + $c; // returning the result return $sum; } // calling add with 2 arguments echo "5 + 10 = " . add(5, 10) .
Answered by
1
Answer:
php // add function with 2 arguments function add($a, $b) { $sum = $a + $b; // returning the result return $sum; } // overloaded add function with 3 arguments function add($a, $b, $c) { $sum = $a + $b + $c; // returning the result return $sum; } // calling add with 2 arguments echo "5 + 10 = " . add(5, 10) .
Explanation:
i hope you understand better
Similar questions