Re: IF statement
| From: | Robert Cummings | Date: | Fri, 19 Oct 2007 01:03:50 +0000 |
| Subject: | Re: IF statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263346@lists.php.net to get a copy of this message | ||
On Thu, 2007-10-18 at 19:57 -0500, ron.php wrote:
> I just tried to send this to the list. I am not trying make it post again, I
> don't think I had the e-mail address correct the first time.
>
> I am trying to stop $component_reference from doing the echo below when the
> value is 5 or 19. I don't have the syntax right though. What did I miss?
>
> Ron
>
> if ( ($component_reference != "5") OR ($component_reference != "19") ) {
> echo "<li><a href=\"index.php?request=" . $request .
> "\">" .
> $component_name . "</a>";
> }
Use AND instead of OR. Otherwise use the following:
if( !($component_reference == "5" OR $component_reference == "19") )
{
echo "<li><a href=\"index.php?request=" . $request .
"\">" .
$component_name . "</a>";
}
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................