0
Php overloading
?php function add($a,$b) { $sum=$a+$b; return $sum; } function add($a,$b,$c) { $sum=$a+$b+$c; return $sum; } echo"sum of 2no".add(1020,20); echo "sum of 3 no".add(10,20,30); ?>
2 Answers
0
First add < before ?php, in functions just write return $a + $b...(this is an advice) and you cannot have 2 same names of functions -> that's the actuall error
0
Overloading means same name