You are here

function advpoll_compare in Advanced Poll 7.2

Same name and namespace in other branches
  1. 7.3 includes/advpoll_voteapi.inc \advpoll_compare()
  2. 7 includes/advpoll_voteapi.inc \advpoll_compare()
1 string reference to 'advpoll_compare'
advpoll_calculate_percentage in includes/advpoll_voteapi.inc
Return keyed array with percentages for each index.

File

includes/advpoll_voteapi.inc, line 182

Code

function advpoll_compare($a, $b) {
  if ($a['percentage'] > $b['percentage']) {
    return 1;
  }
  elseif ($a['percentage'] < $b['percentage']) {
    return -1;
  }
  else {
    return 0;
  }
}