Function sort_by_weight
Sort an array according to the weight of its items.
The weight of the items is defined as an integer; a position relative to another member of the
array before:<key>
or after:<key>
; the special words top
and bottom
.
Parameters summary
array |
$array |
|
callable |
$weight_picker |
<p>The callback function used to pick the weight of the item. The function is called with the following arguments: <code>$value</code>, <code>$key</code>.</p> |
Return value summary
array
|
A sorted copy of the array. |