Home >Backend Development >PHP Tutorial >PHP键值数组合并问题

PHP键值数组合并问题

WBOY
WBOYOriginal
2016-06-23 13:51:221017browse

 [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)

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