<?php
$a = array(
'a'=>'7833',
'd'=>'1297',
'c'=>'341',
'1'=>'67',
'b'=>'225',
'3'=>'24',
'2'=>'44',
'4'=>'22',
'0'=>'84'
);
ksort($a);
print_r($a);
The above code produces the following output.
Array
(
[0] => 84
[a] => 7833
[b] => 225
[c] => 341
[d] => 1297
[1] => 67
[2] => 44
[3] => 24
[4] => 22
)
Why does ksort give wrong result?
10
go, between1
and2
or after9
? – Finnougrian10
isn't an ASCII character (it is two characters), so saying "ASCII order" doesn't make sense, hence asking for clarification. – Finnougriancount_chars()
– Finnougrian