You are here

function _autoassignrole_array_asc in Auto Assign Role 5.2

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

method to sort array in an ascending fashion while preserving keys

Parameters

string $a a string to compare:

string $b a string to compare:

Return value

int

1 call to _autoassignrole_array_asc()
_autoassignrole_intersect in ./autoassignrole.module

File

./autoassignrole.module, line 264

Code

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