$filters = array(-1 => 26, 26 => 51, 51 => 101);
function filterPrices ($filters, $prices)
{
$filteredPrices = array();
foreach ($filters as $min => $max)
$key = "{$min}-{$max}";
$filteredPrices[$key] = array();
foreach($prices as $price)
{
if ( ($price > $min) && ($price < $max) )
{
$filteredPrices[$key][] = $price;
}
}
return $filteredPrices;
}