Quoting Jami <[EMAIL PROTECTED]>:
> I have code that says:
>
> if($_GET['sc'] != '2' OR '8'){
> do this.....
> }
>
> but I doesn't work. What do I need to do to get it to work? I have checked
> operator precendence and all that and am still confused on whether I should
> be using '||' or 'OR' or something else... I have tried both of those, as
> well as 'XOR' and '^'. Help please!
>
> Jami
Try:
if( ( $_GET['sc'] != 2 ) OR ( $_GET['sc'] != 8 ) ){
/*
* Do Foo provided sc is anything but a 2 or 8
*/
do foo;
}
Assuming of course that you meant to exclude cases of 2 or 8. It's a bit hard
to tell what your intended event for 8 is.
--
Ryan T. Gallagher
[EMAIL PROTECTED]
International Studies Abroad
http://www.studiesabroad.com
(512)480-8522
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php