soycharliente Posted January 15, 2010 Share Posted January 15, 2010 How can I sum array values with a condition to not include an element? If I can, I'd be fine with deleting it from the array and saving it for use so that I can use array_sum. Link to comment https://forums.phpfreaks.com/topic/188526-summing-array-values/ Share on other sites More sharing options...
JAY6390 Posted January 15, 2010 Share Posted January 15, 2010 In that case, do it that way. It's either that or use array_sum and then subtract the value of that specific element, or loop through all elements adding to a counter and skipping that element Link to comment https://forums.phpfreaks.com/topic/188526-summing-array-values/#findComment-995293 Share on other sites More sharing options...
soycharliente Posted January 15, 2010 Author Share Posted January 15, 2010 How can I remove an element and save the information I removed? Link to comment https://forums.phpfreaks.com/topic/188526-summing-array-values/#findComment-995294 Share on other sites More sharing options...
JAY6390 Posted January 15, 2010 Share Posted January 15, 2010 array_slice() ? or simply set the value to a temp variable and then use unset($arrayname['key_name']); Link to comment https://forums.phpfreaks.com/topic/188526-summing-array-values/#findComment-995299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.