So, I wanted to avoid anif (...) { }else if (...) { }else { }scenario to avoid duplicating code. After a little playing, I got the following working (works from the testing i've done). Am wondering if anyone has any feedback on this approach or suggestions on on possible improvement?Sometimes I think I know what I'm doing, sometimes I don't.<?php  // define(MEMBER_LIMIT,0); // no member limitdefined(MEMBER_LIMIT,100); // limit to 100 ppl in group  // $memcount is set via sn SQL query$memcount = 9; // number of people currently in group (let's say).if (!defined(MEMBER_LIMIT) || ((defined(MEMBER_LIMIT) && MEMBER_LIMIT == 0) ||   (MEMBER_LIMIT > 0 && $memcount>0 && $memcount < MEMBER_LIMIT))) {  // will do something}else {  // will do something else.}?>
Is this IF ok? Or is there a better way?
php
How about:if (!defined(MEMBER_LIMIT) ||  MEMBER_LIMIT == 0 || $memcount < MEMBER_LIMIT) {  // will do something}else {  // will do something else.}The key is to look for both complementary (multiple items that accomplish the same thing by different means) and contradicting criteria (which would interrupt your desired flow of logic) in if statements