A::sort()
Sorts a multi-dimensional array by a certain column
A::sort(array $array, string $field, string $direction = 'desc', int $method = 0): arrayParameters
| Name | Type | Default | Description | 
|---|---|---|---|
| $arrayrequired | array | no default value | The source array | 
| $fieldrequired | string | no default value | The name of the column | 
| $direction | string | 'desc' | desc (descending) or asc (ascending) | 
| $method | int | 0 | A PHP sort method flag or 'natural' for natural sorting, which is not supported in PHP by sort flags | 
Return type
array
The sorted array
Parent class
Examples
$array[0] = [
  'id' => 1,
  'username' => 'mike',
];