NETSYNC Posted October 21, 2010 Share Posted October 21, 2010 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 More sharing options...
trq Posted October 21, 2010 Share Posted October 21, 2010 if ($item == 1 || $item == 11 || $item == 121) { Link to comment https://forums.phpfreaks.com/topic/216447-if-or/#findComment-1124744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.