function public static function SortArray::sortByKeyString

8.x-3.x SortArray.php public static SortArray::sortByKeyString($a, $b, $key)

Class

SortArray
Extends \Drupal\Component\Utility\SortArray.

Namespace

Drupal\bootstrap\Utility

Source src/Utility/SortArray.php (line 17)

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