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? Quote Link to comment Share on other sites More sharing options...
trq Posted October 21, 2010 Share Posted October 21, 2010 if ($item == 1 || $item == 11 || $item == 121) { Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.