In PHP I have an array that looks like below, but with a lot of more values. I want to select only few values of this array with this conditions : 5 spares of each series with the minimum price. I have done something in my application but it seems very complicated for this simply condition. Do you have any idea that can help me to do this the more simply possible?
[0] => spare
(
[price] => 156
[name] => alpha
[serie] => green
)
[1] => spare
(
[price] => 205
[name] => beta
[serie] => green
)
[2] =>spare
(
[price] => 276
[name] => gamma
[serie] => red
)
[3] => spare
(
[price] => 207
[name] => zeta
[serie] => green
)….