Guest Posted October 12, 2006 Posted October 12, 2006 <?php if (($product_info['products_id']) == 5) { echo 'hello'; } ?> I have the above code and it works fine. Basically if the products_id equal 5 then word Hello is printed. What I require is the coding for: If the Products_id is greater than 4 but less than 8 print hello I have tried these two example but both fail. <?php if (($product_info['products_id']) == 4,5,6,7,8) { echo 'hello'; } ?> <?php if (($product_info['products_id']) > 4 <8) { echo 'hello'; } ?> Anyone help here?
dynamoeffects Posted October 12, 2006 Posted October 12, 2006 <? if ($product_info['products_id'] > 4 && $product_info['products_id'] < 8) { echo 'hello'; } ?> Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.
Guest Posted October 12, 2006 Posted October 12, 2006 Google is an amazing thing, solved it: <?php if (($product_info['products_id']) >= 5 && ($product_info['products_id']) <= 8) { echo 'hello'; } ?>
Guest Posted October 12, 2006 Posted October 12, 2006 Argh posted at the same time, but thank you for you help. Stuart
Recommended Posts
Archived
This topic is now archived and is closed to further replies.