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

请教一下if elseif用法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:53:08
Original
1266 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:
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
Latest Issues
if / else / can elseif be used?
From 1970-01-01 08:00:00
0
0
0
What's wrong?
From 1970-01-01 08:00:00
0
0
0
Why can't my element-ui-form validator be called?
From 1970-01-01 08:00:00
0
0
0
Problem with numbers in reverse order
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template