Click here to Skip to main content
15,880,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 19-Aug-11 2:25am
v4
Comments
Uday P.Singh 19-Aug-11 8:41am    
are you trying to merge the elements of two arrays in a single array and then displaying that array? If yes then you can use array_merge. If no then see my answer.

You should add all the array items in two (nested) loops as you would do in other programming languages.
 
Share this answer
 
check this out:

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

hope it helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900