在PHP中添加数组 [英] addition of array in php

查看:67
本文介绍了在PHP中添加数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,我除了数组还有一个问题
如何在php中添加多维添加数组
如何添加2个数组数组
arr3 [3] [4] = arr1 [3] [4] + arr2 [3] [4]
在sigle数组中添加2个数组,并打印该数组
请给代码添加我不知道的数组

hi friends i have a problem in addition of arrays
how can add multidimension add array in php
how can add 2 arrays arrays are
arr3[3][4]= arr1[3][4]+ arr2[3][4]
addition of 2 array in sigle array and also print that array
please give code to add the array i have no idea

推荐答案

您应该像在其他编程语言中那样,在两个(嵌套)循环中添加所有数组项.
You should add all the array items in two (nested) loops as you would do in other programming languages.


检查一下:

http://php.net/manual/en/function.array-sum.php [ ^ ]

希望对您有所帮助:)
check this out:

http://php.net/manual/en/function.array-sum.php[^]

hope it helps :)


这篇关于在PHP中添加数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆