I currently have an array, the amount of items in the array can change. I am trying to find different combinations for the values inside the array, for example the array currently has these values;
Array
(
[0] => 60.0
[1] => 56.8
[2] => 42.08
[3] => 52.16
[4] => 52.8
)
Is it possible to count the number of values (in this case 5) then do something like this;
60.0 + 56.8
60.0 + 56.8 + 42.08
60.0 + 56.8 + 42.08 + 52.16
60.0 + 56.8 + 42.08 + 52.16 + 52.8
But also to show all combinations such as;
56.8 + 42.08
42.08 + 52.16
etc
I have tried using multi dimensional arrays, array shifting and other array related code.