I am trying to make a top ten list of games for my website. I have an associative array that contains all the information about the games on my site.
$games = array();
$games[] = array(
"title" => 'Disaster will strike 2',
"link_name" => 'disaster-will-strike-2',
"id" => 1,
"desc" => 'Create earthquakes, launch fireballs and cause other crazy disasters to destroy all the eggs in each level.',
"cat" => 'Puzzle',
"img_src" => 'img/disaster_will_strike_2.png',
"play_count" => 0
);
Each game has a key called "play_count" that will go up each time a user goes on to play that game. I would like to list the ten games with the highest play count from highest to lowest. I have know idea how to this. I have tried using for loops, nested for loops, foreach loops and I have no idea what I'm doing wrong. Could anybody help me with this?