运用PHP写计算器(实现加减乘除 取余数)功能





无标题文档 - 锐客网


if(!empty($_POST)){
$num1=$_POST['data1'];
$num2=$_POST['data2'];
$fuhao=$_POST['yunsuanfu'];
if($fuhao == '+'){
$jieguo = $num1+$num2;
}
else if ($fuhao == '-'){
$jieguo = $num1-$num2;
}
else if ($fuhao == '*'){
$jieguo = $num1*$num2;
}
else if ($fuhao == '/'){
$jieguo = $num1/$num2;
}
else if ($fuhao == '%'){
$jieguo = $num1%$num2;
}

}
else{
$jieguo="";
$num1="";
$num2="";
$fuhao="";
}




?>

我的运算器














    推荐阅读