I am sure this is easy, I have just never done so before.
I have an array pulling information from a database. Each piece of information has two parts...a NAME and an ID. Here is the relevant snippet:
$data = $pq->query_members();
// loop through all players returned
sort($data['userid']);
foreach ($data['players'] as $p) {
print "<br />" . $p['name'] . " with User ID of" . $p['userid'] . "<br />\n";
}
This returns:
Bob with User ID of 4
Joe with User ID of 2
Nancy with User ID of 1
Tom with User ID of 3
Obviously the SORT is wrong on the above example. How do I tell it to sort in reverse order on the User ID?
Many thanks, I know this is easy for someone out here 🙂