foreverdita Posted November 19, 2009 Share Posted November 19, 2009 OK, I got as far as to print out my array in a readable format: Array ( [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 79 ) ) [412] => Array ( [qty] => 1 ) [151:e8ca3ed62287fae344adf76181387670] => Array ( [qty] => 1 [attributes] => Array ( [1] => 1 ) ) [55] => Array ( [qty] => 1 ) ) The actual array used (to get this far and print out the above is: function print_r_html ($arr) { ?><pre><? print_r($arr); ?></pre><? } print_r_html($_SESSION['cart']->contents); What I have left to do is to grab this: [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 79 ) ) and update the attributes array to a different number. I cannot for the life of me figure out how to do this. Is there anyone that can help? Quote Link to comment https://forums.phpfreaks.com/topic/182190-solved-need-desperate-help-with-a-complicated-array/ Share on other sites More sharing options...
foreverdita Posted November 19, 2009 Author Share Posted November 19, 2009 so in other words, this: [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 79 ) ) Would become this: [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 105 ) ) Quote Link to comment https://forums.phpfreaks.com/topic/182190-solved-need-desperate-help-with-a-complicated-array/#findComment-961310 Share on other sites More sharing options...
knsito Posted November 19, 2009 Share Posted November 19, 2009 try $arr['169:67700e59c283ae4bc5550efa3e273762']['attributes'][1] = 105; ? Quote Link to comment https://forums.phpfreaks.com/topic/182190-solved-need-desperate-help-with-a-complicated-array/#findComment-961311 Share on other sites More sharing options...
foreverdita Posted November 19, 2009 Author Share Posted November 19, 2009 Thank you - using your code, I was able to get it to work - thank you thank you thank you. Quote Link to comment https://forums.phpfreaks.com/topic/182190-solved-need-desperate-help-with-a-complicated-array/#findComment-961343 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.