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

WBOY
Release: 2016-06-13 10:12:17
Original
848 people have browsed it

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

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php $a = $_POST['a'];$b = $_POST['b'];$c = $a % $b;?>
Copy after login
除以




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


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

引用:


能提交了吗?

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

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

$c = $a % $b;

?>

除以




echo "余数$c";
?>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!