Hi! First of all.. sorry for my bad english 🙂
However.. this is my problem:
I have 14 values selected from a mysql table's row:
a,b,c,a,c,d,b,c,3,4,2,6,4,1,6
each letter has to be "associated" to numbers in this manner:
a,b,a,c,d,b,c
| | | | | | |
3,4,2,6,4,1,6
After the association, i want to calculate the sum of the numbers "associated" to each letters..
In my example:
(3+2)->(sum of numbers from second array "associated" to "a" from first array)
(4+1)->(sum of numbers from second array "associated" to "b" from first array)
(6+6)->(sum of numbers from second array "associated" to "c" from first array)
(4) (the number associated to "d")
and the output of the php script like this
5a 5b 12c 4d
Is this possible?
I tried with array_count_values() but with no results.. because i'm sure i use the function in the wrong manner.. 🙁
Can somebody help me with this script?
Thks!