I have a function called array_sum_identical_keys() which adds (as a sum) array values of identical keys.
I have X number of arrays called $array1 $array2 $array3 etc. all created from a loop earlier in the code.
Since I have X number of arrays, I need to create a loop which will add up all of the array values with my custom function array_sum_identical_keys(), given that I don't know how many arrays I have.
I need to pass each array as an argument to array_sum_identical_keys() like array_sum_identical_keys($array1, $array2, ...) but I need to do this within a loop, adding each argument every time the loop iterates.
In simpler terms: I need to add an argument to a function each time a loop iterates, but I need the function to just be called once, with all arguments.
What would be the best way to go about doing this?
$array1,$array2etc in an array itself. then pass that array as parameter to your method