Jump to content

Adding $vars to get a $sum in for statement


easyedy

Recommended Posts

Hi I have a 3 diminsional array and I need to get a sum of certain quantity but I just can seem to be able to get it. ANy suggestions?

 

for ($qty = 0; $qty < sizeof($result[$FA][$SA]); $qty++) {	
echo array_sum($result[$FA][$SA][$qty]['Quantity']);}

 

If i echo $result[$FA][$SA][$qty]['Quantity'] it spits out all the correct $qty's for each row but I can't figure out to add them all together to get a total sum.

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.