Home > php教程 > php手册 > If you encounter a two-dimensional array and want to get the sum of a certain field

If you encounter a two-dimensional array and want to get the sum of a certain field

WBOY
Release: 2016-09-03 00:00:42
Original
1220 people have browsed it

array_sum(array_column($attr, 'field'));

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template