Jump to content

**solved** Sorting by key ?


acey99

Recommended Posts


[code]function points_sort ($a, $b) {

          if ($a['points'] == $b['points']) return 0;
          return ($a['points'] < $b['points']) ? -1 : 1;
}


usort ($StandingsData, 'points_sort');


// check results

echo '<pre>', print_r ($StandingsData, true), '</pre>';[/code]
Link to comment
https://forums.phpfreaks.com/topic/7771-solved-sorting-by-key/#findComment-28368
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.