You are here

function _autoassignrole_array_desc in Auto Assign Role 6

Same name and namespace in other branches
  1. 5.2 autoassignrole.module \_autoassignrole_array_desc()
  2. 5 autoassignrole.module \_autoassignrole_array_desc()
  3. 6.2 autoassignrole.module \_autoassignrole_array_desc()

method to sort array in a descending fashion while preserving keys

Parameters

string $a a string to compare:

string $b a string to compare:

Return value

int

1 string reference to '_autoassignrole_array_desc'
autoassignrole_user in ./autoassignrole.module
Implementation of hook_user().

File

./autoassignrole.module, line 411
The main autoassignrole.module file

Code

function _autoassignrole_array_desc($a, $b) {
  if ($a == $b) {
    return 0;
  }
  return $a > $b ? -1 : 1;
}