Home  >  Article  >  Backend Development  >  为什么小弟我写的这程序的$a+$b和$a-$b不能计算,别的能计算啊求大神解决!

为什么小弟我写的这程序的$a+$b和$a-$b不能计算,别的能计算啊求大神解决!

WBOY
WBOYOriginal
2016-06-13 12:47:19921browse

为什么我写的这程序的$a+$b和$a-$b不能计算,别的能计算啊,求大神解决!!!
    $a=$_REQUEST["num1"];
$b=$_REQUEST["num2"];
$fuhao=$_REQUEST["fuhao"];

    class Cat{
    public function jisuan($a,$b,$fuhao){

switch($fuhao){
    case"+":
$a+$b;
    echo '$a+$b='.$a+$b;
break;
case"-":
$a-$b;
    echo '$a-$b='.$a-$b;
break;
case"*":
$a*$b;
    echo '$a*$b='.$a*$b;
break;
case"/":
$a/$b;
    echo '$a/$b='.$a/$b;
break;
}
}     
}

$cat1=new cat();
    $cat1->jisuan ($a,$b,$fuhao);

?>

函数
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