如果遇到二维数组 想取某个字段的和

array_sum(array_column($attr, '字段'));

原文地址:https://www.cnblogs.com/zhaoxueru/p/5832839.html