Re: [PHP] reversing an IF statement

2004-05-01 Thread Curt Zirzow
* Thus wrote Kim Steinhaug ([EMAIL PROTECTED]): > Often I end up using a "dumb" IF statement which to me seems that > it could have been done some other way. > > Example : > if( > ($_GET["id"]==1) or > ($_GET["mode"]=="home") or > ((!isset($_GET["item"])) && ($_GET["mode"]=="news")) F

RE: [PHP] reversing an IF statement

2004-05-01 Thread Chris
The easiest method is just to encase all the checks in parenthese, then negate it: if(!( ($_GET["id"]==1) or ($_GET["mode"]=="home") or ((!isset($_GET["item"])) && ($_GET["mode"]=="news")) )) { // This is where we do it } -Original Message- From: Kim Steinhaug [mailt