arsort
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Sort an array in descending order and maintain index association
arsort
(array &
$array
,
int $flags
=
SORT_REGULAR
):
bool
{
$items
=
$this
->
items
;
arsort
(
$items
,
$options
);
return new static(
$items
);
}
src/Illuminate/Collections/Collection.php
$results
[
$key
] =
$callback
(
$value
,
$key
);
}
$descending
?
arsort
(
$results
,
$options
)
:
asort
(
$results
,
$options
);
src/Illuminate/Collections/Collection.php