create a function which accepts two numbers and a symbol to indicate if the user wants to add, substract, multiply, or divide. Include the call to the function in a try/catch structure to capture any attempt to divide by zero
<?php
function add(int $add1, int $add2){
$result = $add1 + $add2;
return $result;
}
function subtract(int $subtract1, int $subtract2){
$result1 = $subtract1 - $subtract2;
return $result1;
}
function multiply(int $multiply1, int $multiply2){
$result2 = $multiply1 * $multiply2;
return $result2;
}
function divide(int $divide1, int $divide2){
$result3 = $divide1 % $divide2;
return $result3;
}
$a = "divide";
switch ($a) {
case "add":
echo add(12,12);
break;
case "subtract":
echo subtract(12,3);
break;
case "multiply":
echo multiply(12,12);
break;
case "divide":
echo divide(12,2);
break;
default:
echo "String was not found";
break;
}