function drupal_sort_title

drupal_sort_title($a, $b)

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

File

includes/common.inc, line 6516
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']);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_sort_title/7.x