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

请教一下if elseif用法

WBOY
Release: 2016-06-23 13:53:08
Original
1235 people have browsed it

$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) ){

}

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