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

WBOY
Release: 2016-06-13 11:24:04
Original
801 people have browsed it

为什么我写的这程序的$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);

?>

函数
Related labels:
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 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!