Reference

Guide

A::sort()

Sorts a multi-dimensional array by a certain column

A::sort(array $array, string $field, string $direction = 'desc', int $method = 0): array

Parameters

Name Type Default Description
$array array

The source array

$field string

The name of the column

$direction string 'desc'

desc (descending) or asc (ascending)

$method int

A PHP sort method flag or 'natural' for
natural sorting, which is not supported in
PHP by sort flags

Return type

array

Source code

kirby/src/Toolkit/A.php#L461