How can I specify what order items should appear in an array?
I am given a 3 level array, somewhat like the following:
Array
(
[AK] => Array
(
[ACO] => Array
(
[FFS] => Array
(
[Medicaid] => -
[CHIP] => -
)
)
[ZCO] => Array
(
[FFS] => Array
(
[Medicaid] => -
[CHIP] => -
)
)
[Other] => Array
(
[FFS] => Array
(
[Medicaid] => -
[CHIP] => -
)
)
)
[AR] => Array
(
[Other] => Array
(
[Other] => Array
(
[Medicaid] => -
[CHIP] => -
)
)
[ACO] => Array
(
[FFS] => Array
(
[Medicaid] => -
[CHIP] => -
)
)
[ZCO] => Array
(
[FFS] => Array
(
[Medicaid] => -
[CHIP] => -
)
)
)
)
How can I make them sort list the first element [AK], by the second level named element(I need them both to be [ACO], [ZCO], [Other])?
Otheris always last, but other items are arbitrary or do you always have the same three elementsACO,ZCO,Other?[AK]element, via[ACO], [ZCO], [Other]ARby the position of elements inAK, or you can devise a rule that would sort both as you want - ie sorting by length ascending and then normal ascending. Which would be best for your real problem? Also, do you know by what ruleAKis sorted?AK, AL, ARetc... like I said, I kept a bunch out of this to keep the question shorter :)