Skip navigation
Help

drupal_sort_title

7 common.inc drupal_sort_title($a, $b)

Array sorting callback; sorts elements by 'title' key.

1 string reference to 'drupal_sort_title'

File

drupal/includes/common.inc, line 6085
Common functions that many Drupal modules will need to reference.

Code

function drupal_sort_title($a, $b) {
  if (!isset($b['title'])) {
    return -1;
  }
  if (!isset($a['title'])) {
    return 1;
  }
  return strcasecmp($a['title'], $b['title']);
}