erme Posted April 2, 2012 Share Posted April 2, 2012 Hi, I am basically trying to apply a different amount to $defineMe for certain numbers of an array .. in this case it's array numbers 11 - 16 <?php if ($defineNumber > 11 and $defineNumber < 16) { $defineMe = 35.00; } else { $defineMe = 50.00; } $defineNumber[01] = array('name'=>'Product 1'); $defineNumber[02] = array('name'=>'Product 2'); $defineNumber[03] = array('name'=>'Product 3'); $defineNumber[04] = array('name'=>'Product 4'); $defineNumber[05] = array('name'=>'Product 5'); $defineNumber[06] = array('name'=>'Product 6'); $defineNumber[11] = array('name'=>'Product 11'); $defineNumber[12] = array('name'=>'Product 12'); $defineNumber[13] = array('name'=>'Product 13'); $defineNumber[14] = array('name'=>'Product 14'); $defineNumber[15] = array('name'=>'Product 15'); $defineNumber[16] = array('name'=>'Product 16'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/260181-different-variable-for-array/ Share on other sites More sharing options...
trq Posted April 2, 2012 Share Posted April 2, 2012 And you are stuck where? Quote Link to comment https://forums.phpfreaks.com/topic/260181-different-variable-for-array/#findComment-1333494 Share on other sites More sharing options...
erme Posted April 2, 2012 Author Share Posted April 2, 2012 It current just reads $defineMe as 50.00 no matter what Quote Link to comment https://forums.phpfreaks.com/topic/260181-different-variable-for-array/#findComment-1333496 Share on other sites More sharing options...
trq Posted April 2, 2012 Share Posted April 2, 2012 You are doing nothing to prevent that from happening. Quote Link to comment https://forums.phpfreaks.com/topic/260181-different-variable-for-array/#findComment-1333499 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.