Home  >  Article  >  Backend Development  >  自已想搞个PHP版的余数计算器,但是一直出错。请高手帮小弟我看看,多谢

自已想搞个PHP版的余数计算器,但是一直出错。请高手帮小弟我看看,多谢

WBOY
WBOYOriginal
2016-06-13 13:43:48822browse

自已想搞个PHP版的余数计算器,但是一直出错。请高手帮我看看,谢谢

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><?php $a = $_POST['a'];
$b = $_POST['b'];

$c = $a % $b;

?>
除以




------解决方案--------------------
报什么错!还有你的$a,$b两个数字,要转化为数字才可以的。
------解决方案--------------------
探讨


------解决方案--------------------
探讨

引用:


能提交了吗?

if(isset($c)){ echo "余数:$c
"; }
?>

------解决方案--------------------
$a = $_POST['a'];
$b = $_POST['b'] or $b= 1;

$c = $a % $b;

?>

除以




echo "余数$c";
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn