PHP » GoLang |
login |
register |
about
|
|
Ds\Map::ksort(PECL ds >= 1.0.0) Ds\Map::ksort — Sorts the map in-place by key Description
Sorts the map in-place by key, using an optional Parameters
Return ValuesNo value is returned. ExamplesExample #1 Ds\Map::ksort() example
<?phpThe above example will output something similar to:
Ds\Map Object
(
[0] => Ds\Pair Object
(
[key] => a
[value] => 1
)
[1] => Ds\Pair Object
(
[key] => b
[value] => 2
)
[2] => Ds\Pair Object
(
[key] => c
[value] => 3
)
)
Example #2 Ds\Map::ksort() example using a comparator
<?phpThe above example will output something similar to:
Ds\Map Object
Ds\Map Object
(
[0] => Ds\Pair Object
(
[key] => 2
[value] => y
)
[1] => Ds\Pair Object
(
[key] => 1
[value] => x
)
[2] => Ds\Pair Object
(
[key] => 0
[value] => z
)
)
|
more
Most requested
more
Last requests
|