function advpoll_compare in Advanced Poll 7
Same name and namespace in other branches
- 7.3 includes/advpoll_voteapi.inc \advpoll_compare()
- 7.2 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 177 
Code
function advpoll_compare($a, $b) {
  if ($a['percentage'] > $b['percentage']) {
    return 1;
  }
  else {
    if ($a['percentage'] < $b['percentage']) {
      return -1;
    }
    else {
      return 0;
    }
  }
}