← All docs

ksort()

Sorts an array by key in ascending order.

ksort()

function ksort(array $array): bool

Sorts an array by key in ascending order.

Parameters:

  • $array (array), passed by reference

Returns: bool

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how ksort is implemented in the compiler, see the internals page.