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

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

Jun 13, 2016 am 10:12 AM
gt input lt quot type

自已想搞个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";
?>
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

What are the differences between Huawei GT3 Pro and GT4?

Fix: Snipping tool not working in Windows 11 Fix: Snipping tool not working in Windows 11 Aug 24, 2023 am 09:48 AM

Fix: Snipping tool not working in Windows 11

What are the uses of the Type keyword in Go? What are the uses of the Type keyword in Go? Sep 06, 2023 am 09:58 AM

What are the uses of the Type keyword in Go?

How to implement laravel input hidden field How to implement laravel input hidden field Dec 12, 2022 am 10:07 AM

How to implement laravel input hidden field

Solve Ubuntu mounting mobile hard disk error: unknown file system type exfat Solve Ubuntu mounting mobile hard disk error: unknown file system type exfat Jan 05, 2024 pm 01:18 PM

Solve Ubuntu mounting mobile hard disk error: unknown file system type exfat

How to encapsulate input components and unified form data in vue3 How to encapsulate input components and unified form data in vue3 May 12, 2023 pm 03:58 PM

How to encapsulate input components and unified form data in vue3

How to Fix Can't Connect to App Store Error on iPhone How to Fix Can't Connect to App Store Error on iPhone Jul 29, 2023 am 08:22 AM

How to Fix Can't Connect to App Store Error on iPhone

Detailed explanation of input box binding events in Vue documents Detailed explanation of input box binding events in Vue documents Jun 21, 2023 am 08:12 AM

Detailed explanation of input box binding events in Vue documents

See all articles