php - How to sum second fields from two arrays? -
i have 2 arrays:
name1 5 name2 10
name1 11 name2 10
i want output
name1 16 name2 20
how can this?
please specific 5 .... elements or int elements
assuming u want merge 2 arrays
define array name_1_2[16]
for(int i=0;i<5;i++) { name_1_2[i]=name1[i]; } for(int i=0;i<7;i++) { name_1_2[5+i]=name2[i]; }
Comments
Post a Comment