<?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);