priority_cards($types); } function topcard_format($card_list) { $ret = []; foreach ($card_list as $item) { $card = new topcard($item); $item = $card->format(); $item['card_type'] = scard_type($item['card_type']); $ret[] = $item; } return $ret; }