Is there a better way to write this if statement
Posted: Fri Dec 05, 2003 12:10 pm
I have an if statement that looks through a product database for certain IPs based on a a previous query. I don't know exactly how to look for about 20 of the id numbers so this is what I've come up with:
As of now I do not think it is working. Is there a better way to do this or make this work? I want to look for product ids listed above and if any or all or a few of them is found I need to set that imprint service variable to yes.
any help is greatly appreciated!
Code: Select all
<?php
if (($order->products[$i]['id'] == "150") || ($order->products[$i]['id'] == "149") || ($order->products[$i]['id'] == "147") || ($order->products[$i]['id'] == "146") || ($order->products[$i]['id'] == "143") || ($order->products[$i]['id'] == "142") || ($order->products[$i]['id'] == "139") || ($order->products[$i]['id'] == "138") || ($order->products[$i]['id'] == "137") || ($order->products[$i]['id'] == "136") || ($order->products[$i]['id'] == "135") || ($order->products[$i]['id'] == "134") || ($order->products[$i]['id'] == "132") || ($order->products[$i]['id'] == "131") || ($order->products[$i]['id'] == "129") || ($order->products[$i]['id'] == "128") || ($order->products[$i]['id'] == "127") || ($order->products[$i]['id'] == "126") || ($order->products[$i]['id'] == "125") || ($order->products[$i]['id'] == "123") || ($order->products[$i]['id'] == "121") || ($order->products[$i]['id'] == "120") || ($order->products[$i]['id'] == "119") || ($order->products[$i]['id'] == "118") || ($order->products[$i]['id'] == "117")) {
$Imprint_service = "Yes";
}
?>any help is greatly appreciated!