sort
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Sort an array in ascending order
sort
(array &
$array
,
int $flags
=
SORT_REGULAR
):
bool
} else {
$descending
?
rsort
(
$array
,
$options
)
:
sort
(
$array
,
$options
);
}
return
$array
;
src/Illuminate/Collections/Arr.php
if (
preg_match
(
'/(?P<imports>(?:use [^;{]+;$\n?)+)/m'
,
$stub
,
$match
)) {
$imports
=
explode
(
"\n"
,
trim
(
$match
[
'imports'
]));
sort
(
$imports
);
return
str_replace
(
trim
(
$match
[
'imports'
]),
implode
(
"\n"
,
$imports
),
$stub
);
}
src/Illuminate/Console/GeneratorCommand.php
sort
(
$segments
);
return
strtolower
(
implode
(
'_'
,
$segments
));
}
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
}
}
sort
(
$keys
);
return
array_values
(
array_unique
(
$keys
));
}
src/Illuminate/Database/Eloquent/Relations/BelongsTo.php
$this
->
components
->
twoColumnDetail
(
' <fg=green;options=bold>'
.
$section
.
'</>'
);
sort
(
$data
);
foreach (
$data
as
$detail
) {
[
$label
,
$value
] =
$detail
;
src/Illuminate/Foundation/Console/AboutCommand.php