Home > php教程 > php手册 > body text

php小功能详解

WBOY
Release: 2016-06-13 10:48:47
Original
1623 people have browsed it

$dy=$_POST["dy"];
$de=$_POST["de"];
$jsf=$_POST["select"];
$qingkong=$_POST["qingkong"];
$Submit=$_POST["Submit"];

if($jsf=="jia"){
$zhi=$dy+$de;
$zhi="你的计算结果为:$zhi";
}
if($jsf=="jian"){
$zhi=$dy-$de;
$zhi="你的计算结果为:$zhi";
}
if($jsf=="chen"){
$zhi=$dy*$de;
$zhi="你的计算结果为:$zhi";
}
if($jsf=="chu"){
if($de=="0"){
$zhi="被除数不能为0,请从新输入有效的数字!";
}else{
$zhi=$dy/$de;
$zhi="你的计算结果为:$zhi";
}
}
if($jsf=="yu"){
if($de=="0"){
$zhi="求余数不能为0";
}else{
$zhi=$dy%$de;
}
}

if($qingkong=="清空"){
unset($dy,$de,$zhi);
}

?>


计数器













简单计算器














摘自 战地日记_LAMP兄弟连
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 Recommendations
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!