Home  >  Article  >  Backend Development  >  empty如何样判断多个变量

empty如何样判断多个变量

WBOY
WBOYOriginal
2016-06-13 12:44:081432browse

empty怎么样判断多个变量
如果一个IF语句用empty来判断多个变量怎么办,我试过好像不可以

<br />
$top='33';<br />
$metop='';<br />
<br />
if(empty($top)&&empty($metop)){  //这个地方可以用&& 来判断么,就是$top和$metop为空就提示,并且退出<br />
  echo '为空';<br />
  exit;<br />
}<br />
<br />
echo 'thank you!';   //如果上面为空,这里的地方也就不会显示出来了.<br />
<br />

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