Jump to content

Logical Operators Help!!


pauleth

Recommended Posts

Hey folks,

So I am hoping to find a little help with logical operators.

 

I have this code:

 

if (empty($roll_id) || (!empty($manufacturer) AND !empty($iso))) {

        ////////////////  CODE GOES HERE ////////////////

}

 

I want it to work like this...

 

If Condition 1 is TRUE OR Condition 2 is TRUE, then...

 

Condition 1 being:

 

empty($roll_id)

 

Condition 2 being:

 

!empty($manufacturer) AND !empty($iso) 

 

The code actually appears to work the way I want it to, but I'm not very familiar with order of precedence, and I was wondering if there is a better way to write it.  Thanks for your assistance.

Link to comment
https://forums.phpfreaks.com/topic/101388-logical-operators-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.