jrahma;11036755 wrote:I want the row to be shown if NOT null or empty that's why I I am saying !is_null
But you're OR'ing that with !isset().
Simple example; say $company_region is truly set to the PHP NULL value (something you haven't confirmed, by the way, e.g. via [man]var_dump/man). Your if() statement:
if (!isset($company_region) || !empty($company_region) || !is_null($company_region)
is equivalent to:
if (TRUE || FALSE || FALSE)
which is, of course, evaluated as TRUE.
Simply put: you've managed to form an if() condition that can never evaluate to FALSE.
jrahma;11036755 wrote:I was trying to find where is the issue.
Well... over-complicating the code by adding more and more function calls is an issue in and of itself, I'd say.
You haven't shown us how $company_region is defined, but I'm guessing that this piece of code will be executed after that variable is unconditionally assigned some value. So, isset() probably doesn't make much sense just based on semantics.
Next, note that [man]empty/man considers a lot more values than just NULL as 'empty', but you've only mentioned NULL. So, empty() doesn't work just based on your requirements.
Finally, we're left with [man]is_null/man, which makes the best fit not only based on requirements but semantics too. In other words: remove the other two functions and stick with the one that makes sense. (Then again, perhaps your requirements will change if and when you confirm that $company_region is actually NULL and not some other loosely-equivalent value.)