Home > Backend Development > PHP Tutorial > Detailed explanation of php small functions_PHP tutorial

Detailed explanation of php small functions_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:50:27
Original
1074 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="Your calculation result is:$zhi";
}
if($jsf=="jian"){
$zhi=$dy-$de;
$zhi="Your calculation result is:$zhi";
}
if($jsf=="chen"){
$zhi=$dy*$de;
$zhi="Your calculation result is:$zhi";
}
if($jsf=="chu"){
if($de=="0"){
$zhi="The dividend cannot be 0, please re-enter a valid number!";
}else{
$zhi=$dy/$de;
$zhi="Your calculation result is:$zhi";
}
}
if($jsf=="yu"){
if($de=="0"){
$zhi="The remainder cannot be 0";
}else{
$zhi=$dy%$de;
}
}

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

?>


Counter













Simple Calculator














Excerpted from Battlefield Diary_LAMP Band of Brothers

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478269.htmlTechArticle?php $dy=$_POST[dy]; $de=$_POST[de]; $jsf=$ _POST[select]; $qingkong=$_POST[qingkong]; $Submit=$_POST[Submit]; if($jsf==jia){ $zhi=$dy+$de; $zhi=Your calculation result is:$ zhi; } if($js...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template