简单计算方法
程序员文章站
2022-04-23 14:41:39
...
跳至
<?php function jisuan($m,$rum,$n){ switch($rum){ case '+': echo $r=$m + $n; break; case "-": echo $r=$m - $n; break; case "*": echo $r=$m * $n; break; case "/": echo $r=$m / $n; break; } } jisuan(1,'+',3); echo " "; jisuan(2,'*',5); echo " "; jisuan(12,'/',6);