• Register
Welcome to phpanswers , where you can ask questions and receive answers from other members of the community.

how to create a php function with in a function

0 votes

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

 

asked 11 months ago by Biniam Yosief (110 points)
It’s a really very informative information. It’s very useful and knowledgeable for me. I will bookmark this page and come soon to see the updates.
http://web2sms.pk

Your answer

Email me at this address if my answer is selected or commented on:
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

0 Answers

Related questions