Home  >  Article  >  Backend Development  >  请教一下if elseif用法

请教一下if elseif用法

WBOY
WBOYOriginal
2016-06-23 13:53:081172browse

$mm=1;
$dd=2;
$bb=66;
$temp='abc';

if(isset($mm)){
$temp.=' +def';
}
elseif(isset($cc)){
$temp.=' +gh';
}
elseif(isset($bb)){
$temp.=' +gh';
}
else{
$temp='+mnb';
}
echo $temp;
如何实现让变量temp的值是一直向继承的,比如只有isset($mm)和isset($bb)为真,则$temp值为abc+def+mnb
asp里面可以用if then实现,php里面该如何实现这样的功能


回复讨论(解决方案)

if(isset($mm) &&isset($bb) ){

}

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