直接来代码吧,废话少说
1.array_sum(array_map(function($user_order){return $user_order['price'];}, $user_order));
2.array_sum(array_column($data,'field'))
直接来代码吧,废话少说
1.array_sum(array_map(function($user_order){return $user_order['price'];}, $user_order));
2.array_sum(array_column($data,'field'))
本文标题:php 二维数组求出某个字段的和
本文链接:https://www.haomeiwen.com/subject/awljaktx.html
网友评论