Home  >  Article  >  php教程  >  php小功能详解

php小功能详解

WBOY
WBOYOriginal
2016-06-13 10:48:471674browse

$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兄弟连
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