首页 > 代码库 > OperService.class.php

OperService.class.php

<?php
class OperSerVice{
public function getResult($num1,num2,oper){
switch($oper){
case "+":
return $num1+$num2;
break;
case "-":
return $num1-$num2;
break;
case "*":
return $num1*$num2;
break;
case

return $num1/$num2;
break;
default:
echo "操作符错误";
}}}
?>

 

OperService.class.php