function add($x,$y){
return $x*$y;
}
//this will get me the sum of x n y when called upon
now what i need is to create a function that accepts three arguments and performs the desierd operation depending on the third argument
function mat_operations($x,$y,$add){
/*this function must contain a code that checks the third argument if it is add ,subtract, multiply or devide and @ last if it is add ,it returns $x+$y */
;}
// i 'll call the function here like
print mat_operations(4,2,$add)
output:
6