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

我的第一个PHP程序

WBOY
Release: 2016-06-13 10:44:11
Original
1271 people have browsed it


 


   <br>      <?php <br />    echo "我的计算器";<br>    ?><br>   
 

 
 
我的计算器

 

 num1:

 num2:

 计算方式:
 

 

 
    $num1 = $_POST['num1'];
  $num2 =$_REQUEST['num2'];
  $run = $_REQUEST['run'];
   switch($run)
   {
     case '+':print("两数之和为:".($num1+$num2));break;
  case '-':print("两数之差为:".($num1-$num2));break;
  case '*':print("两数之乘积为:".($num1*$num2));break;
  case '/':print("两数之和为:".($num1/$num2));break;
   }
 ?>
 

 

本文出自 “ITeamsky-杨波的技术空间” 博客
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