ksort
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Sort an array by key in ascending order
ksort
(array &
$array
,
int $flags
=
SORT_REGULAR
):
bool
if (static::
isAssoc
(
$array
)) {
$descending
?
krsort
(
$array
,
$options
)
:
ksort
(
$array
,
$options
);
} else {
$descending
?
rsort
(
$array
,
$options
)
src/Illuminate/Collections/Arr.php
{
$items
=
$this
->
items
;
$descending
?
krsort
(
$items
,
$options
) :
ksort
(
$items
,
$options
);
return new static(
$items
);
}
src/Illuminate/Collections/Collection.php
else {
foreach (
$values
as
$key
=>
$value
) {
ksort
(
$value
);
$values
[
$key
] =
$value
;
}
src/Illuminate/Database/Query/Builder.php
$values
= [
$values
];
} else {
foreach (
$values
as
$key
=>
$value
) {
ksort
(
$value
);
$values
[
$key
] =
$value
;
}
}
src/Illuminate/Database/Query/Builder.php
$values
= [
$values
];
} else {
foreach (
$values
as
$key
=>
$value
) {
ksort
(
$value
);
$values
[
$key
] =
$value
;
}
src/Illuminate/Database/Query/Builder.php
$files
[
$directory
.
basename
(
$file
->
getRealPath
(),
'.php'
)] =
$file
->
getRealPath
();
}
ksort
(
$files
,
SORT_NATURAL
);
return
$files
;
}
src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
$parameters
=
$parameters
+ [
'expires'
=>
$this
->
availableAt
(
$expiration
)];
}
ksort
(
$parameters
);
$key
=
call_user_func
(
$this
->
keyResolver
);
src/Illuminate/Routing/UrlGenerator.php
protected function
reorderAssocKeys
(array
$data
)
{
$data
=
Arr
::
dot
(
$data
);
ksort
(
$data
);
$result
= [];
src/Illuminate/Testing/AssertableJsonString.php
$this
->
ensureSorted
(
$arg
);
}
ksort
(
$value
);
}
src/Illuminate/Testing/Fluent/Concerns/Matching.php