Question: I am having trouble with my IF statement, it is always TRUE although this is incorrect. I'm using an OR operator as there are two possible scenarios I want to capture in the IF statement. 

The array string ad\_status is "1" but using the below -3 is returned, I'm expecting the IF to be FALSE. If I remove the OR and second statement from the IF, the result of the IF is correct. 

What have I done wrong? Thanks.

```
    if(($getadstatus['ad_status'] != "1" || $getadstatus['ad_status'] != "4"))
    {
        return -3;
        exit;
    }

```

Additional:
What I want to do is exit the function (not seen in full here) if ad\_status does not equal 1 or 4. If it equals any other value other than 1 or 4, the IF statement should return TRUE and exit. 
ad\_status could be any value from 0 to 4.

Answer: 
What you are saying is that any value that is `not 1` OR is `not 4` should return true.

For '1' you get the statement

```
if( 1 != 1 || 1 != 4)

```

which translates to

```
if( false || true )

```

which is ofcourse true.

What you need is:

```
if(!($value == 1 || $value==4))

```

which is the same as ([de Morgan's law](http://en.wikipedia.org/wiki/De_Morgan's_laws))

```
if($value != 1 && $value != 4)

```
You want to use &&

```
if(($getadstatus['ad_status'] != "1" && $getadstatus['ad_status'] != "4"))
{
    return -3;
    exit;
}

```