Reputation: 83
I want use && operator and Not operator at the same time in IF statement. If it is possible then how to write it. Below is the statement which i have written is it right?
if(!$row['sl_name'] && !$row['sn_name']){
}
Upvotes: -3
Views: 176
Reputation: 1301
You can write like this if you wish to check for blank variables:
if(!empty($row['sl_name']) && !empty($row['sn_name'])){
}
else{
}
It checks for both the variables are not empty if anyone of them is empty it goes to else part.
Upvotes: 1