Home  >  Article  >  Backend Development  >  PHP键值数组合并有关问题

PHP键值数组合并有关问题

WBOY
WBOYOriginal
2016-06-13 12:05:01846browse

PHP键值数组合并问题

本帖最后由 u013819883 于 2014-08-19 15:36:04 编辑  [Other] => Array
                (
                    [] => 126
                    [04] => 2502
                    [05] => 3711
                    [06] => 4056
                    [07] => 970
                    [08] => 0
                    [zz] => 88
                )
PS:这结果是数据库查出来的。。
综上所述,我想把数组中的$v的部分合并掉

最好合并成

[other] => Array
         (
           ['Sum'] = > XXX

)
注:XXX是上面值的综合

------解决方案--------------------
array_sum($arr)
Statement:
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