Re: How to: If($var != '#' OR '#')
| From: | Jason Wong | Date: | Wed, 20 Nov 2002 17:31:23 +0000 |
| Subject: | Re: How to: If($var != '#' OR '#') | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125276@lists.php.net to get a copy of this message | ||
On Thursday 21 November 2002 01:24, Jami wrote:
> 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!
Each of the comparison needs to be specified explicitly:
if ($_GET['sc'] != '2' AND $_GET['sc'] != '8') {
do_this_if_neither_2_nor_8;
}
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Always there remain portions of our heart into which no one is able to enter,
invite them as we may.
*/