src/Drupal/Component/Utility/SortArray.php
public static function sortByKeyString($a, $b, $key) {
    $a_title = (is_array($a) && isset($a[$key])) ? $a[$key] : '';
    $b_title = (is_array($b) && isset($b[$key])) ? $b[$key] : '';

    return strnatcasecmp($a_title, $b_title);
  }
public static function sortByKeyString($a, $b, $key) {
    $a_title = (is_array($a) && isset($a[$key])) ? $a[$key] : '';
    $b_title = (is_array($b) && isset($b[$key])) ? $b[$key] : '';

    return strnatcasecmp($a_title, $b_title);
  }
public static function sortByKeyString ( $ a , $ b , $ key ) { $ a_title = ( is_array ( $ a ) && isset ( $ a [ $ key ] ) ) ? $ a [ $ key ] : '' ; $ b_title = ( is_array ( $ b ) && isset ( $ b [ $ key ] ) ) ? $ b [ $ key ] : '' ; return strnatcasecmp ( $ a_title , $ b_title ) ; }
Sorts a string array item by an arbitrary key.

@param array $a
First item for comparison.
@param array $b
Second item for comparison.
@param string $key
The key to use in the comparison.

@return int
The comparison result for uasort().
Sorts a string array item by an arbitrary key .