22-02-2011, 12:22 AM
Tu sais Sephi tu peux aussi simplifier en PHP, ce n'est pas incorrect.
$instances_by_zones_by_map = array();
$instances = array(
array('name' => 'Blackwing Descent', 'zone_name' => 'Blackrock Mountain', 'map_name' => 'Eastern Kingdoms'),
array('name' => 'Blackrock Caverns', 'zone_name' => 'Blackrock Mountain', 'map_name' => 'Eastern Kingdoms'),
array('name' => 'Bastion of Twilight', 'zone_name' => 'Twilight Highlands', 'map_name' => 'Eastern Kingdoms'),
array('name' => 'Throne of the Four Winds', 'zone_name' => 'Uldum', 'map_name' => 'Kalimdor')
);
foreach($instances as $instance)
$instances_by_zones_by_map[$instance['map_name']][$instance['zone_name']][] = $instance;