Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 IF 语句中同时使用 && 运算符和 Not 运算符。如果可以,那怎么写。以下是我写的声明对吗?
if(!$row['sl_name'] && !$row['sn_name']){ }
如果你想检查空白变量,你可以这样写:
if(!empty($row['sl_name']) && !empty($row['sn_name'])){ } else{ }
它检查两个变量是否为空,如果其中任何一个为空,则转到其他部分。