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

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -