Jump to content

If or?


NETSYNC

Recommended Posts

How can I add an if statement with "or" ?

 

I have this:

if ($item=="1")
                $pic="images/item.png";
             elseif ($item=="2")
                 $pic="images/item2.png";
elseif ($item=="3")
                 $pic="images/item3.png";
			else
                $pic="";

 

How do I add an "or" case to the item?  Like

if ($item=="1 OR 11 OR 121")
                $pic="images/item.png";
             elseif ($item=="2" OR 22 or 233)
                 $pic="images/item2.png";
elseif ($item=="3 OR 35 OR 37")
                 $pic="images/item3.png";
			else
                $pic="";

 

Is this possible?

Link to comment
https://forums.phpfreaks.com/topic/216447-if-or/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.