Home  >  Article  >  Backend Development  >  为什么我的if判断执行过后还会执行else中的if,是我的代码问题么

为什么我的if判断执行过后还会执行else中的if,是我的代码问题么

WBOY
WBOYOriginal
2016-06-23 13:11:263031browse


回复讨论(解决方案)

prin_r() 一下$id  $aid  看看是不是不一样啊晕

无论 $id、$aid 是否相等,删除都会进行

应该怎么写才能先判断是否相同,如果相同就不执行后面的内容,不相同在继续执行

把删除语句写在第一个 if 语句的 else 分支的开始处
因为你用的截图,所以不贴代码了,以免抄错

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