function formatPrices($prices) { if (!is_array($prices)) { return; } if (count($prices) == 1) { return REOutput::formatprice($prices[0]->price); } $res = array(); foreach ($prices as $p) { $res[] = REOutput::formatprice($p->price) . ' (' . $p->name . ')'; } return implode(' / ', $res); }