Summing multiple arrays


#1

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.


#2

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


#3

or array_column


#4

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