You are here

function kwresearch_count_sort in Keyword Research 7

Same name and namespace in other branches
  1. 6 kwresearch.module \kwresearch_count_sort()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'kwresearch_count_sort'
kwresearch_get_keyword_stats_data in includes/stats.inc
Generates analysis data for keyword stats report. Data is generated by

File

./kwresearch.module, line 1550

Code

function kwresearch_count_sort($a, $b) {
  $a_count = is_array($a) && isset($a['_searches']) ? $a['_searches'] : 0;
  $b_count = is_array($b) && isset($b['_searches']) ? $b['_searches'] : 0;
  if ($a_count == $b_count) {
    return 0;
  }
  return $a_count > $b_count ? -1 : 1;
}