时间:2021-07-01 10:21:17 帮助过:18人阅读
结果为:'.$_SESSION['rs'];
header("content-type:text/html;charset=utf-8");
session_start();
?>
简单计算机
$num1=$_POST['num1'];
$num2=$_POST['num2'];
$oper=$_POST['oper'];
$rs=0;
switch($oper){
case "+":
$rs=$num1+$num2;
break;
case "-":
$rs=$num1-$num2;
break;
case "*":
$rs=$num1*$num2;
break;
case "/":
$rs=$num1/$num2;
break;
default: echo "您输入的不正确";
}
$_SESSION['rs']=$rs;
echo '计算
http://www.bkjia.com/PHPjc/676921.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/676921.htmlTechArticle用php实现加减乘除计算器。代码很简单哦! 代码如下:?php header("content-type:text/html;charset=utf-8"); session_start(); ? !DOCTYPE html PUBLIC "-/...