I have a random array containing an alphanumeric sequence in its keys. Using the ksort function, I get the following result:
array(22) {
["A1"]=>
string(2) "A1"
["A10"]=>
string(3) "A10"
["A11"]=>
string(3) "A11"
["A12"]=>
string(3) "A12"
["A2"]=>
string(2) "A2"
["A4"]=>
string(2) "A4"
["A5"]=>
string(2) "A5"
}
However, ordering must prioritize the numerical order of the keys. The expected result is:
array(22) {
["A1"]=>
string(2) "A1"
["A2"]=>
string(3) "A2"
["A4"]=>
string(2) "A4"
["A5"]=>
string(2) "A5"
["A10"]=>
string(2) "A10"
["A11"]=>
string(3) "A11"
["A12"]=>
string(3) "A12"
}