Let's say I have 4 arrays with the same amount of values in each:
$array1 = array(0, 7, 5, 0);
$array2 = array(2, 6, 10, 0);
$array3 = array(4, 8, 15, 10);
$array4 = array(6, 7, 20, 10);
I want to count the average for all 4 of these arrays for each index. So I should get something like this:
array(3, 7, 12.5, 5);
For more dynamically usage lets say for example 6 arrays or more, you can use this code:
Output: (Demo)