PHP sum array value based on textual duplicate in another array
问题 I have two arrays, both will always be the same count length. One has doubles mixed with integers, the second has textual (string only) values. They do correlate so I need them both to stay in order. Sorry no keys to work with (by design). I need to sum the values where I have duplicates in the array that has strings. Example $dataLabelGraph = array(3, 8, 1, 4.85, 1, 0.5, 6.01, 7); $dataCalcGraph = array("Coding", "Web development - Coding", "Meeting", "Coding", "Coding", "Content", "Coding",