1 drupal.inc element_sort_by_title($a, $b)

Sorts a structured array by '#title' property.

Deprecated

since 1.0.0

See also

backdrop_sort()

Related topics

File

core/includes/drupal.inc, line 1321
Contains constants and function wrappers for Drupal 7.x compatibility.

Code

function element_sort_by_title($a, $b) {
  watchdog_deprecated_function('drupal', __FUNCTION__);
  $a_title = (is_array($a) && isset($a['#title'])) ? $a['#title'] : '';
  $b_title = (is_array($b) && isset($b['#title'])) ? $b['#title'] : '';
  return strnatcasecmp($a_title, $b_title);
}