Summing multiple arrays

Hi guys, Hoping someone can help with this one please…

I am multiple arrays which all have the same structure, but different names.

So for example, I have:

abc[name, class, height]
def[name, class, height]
xyz[name, class, height]

How would I sum all the heights?

Thanks!

Rob.

extract the heights, sum them up. Cf. http://php.net/array-map, http://php.net/array-sum

or array_column

Perfect! array_column will get the job done, thank you!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.