Sorting alphabetically an array.
Posted: Thu Jul 30, 2009 9:48 pm
Code: Select all
$countries= array(
'Zambia' => array (
'CIP' => 'Chipata, Zambia (CIP)',
'KAA' => 'Kasama, Zambia (KAA)',
'ZKB' => 'Kasaba Bay, Zambia (ZKB)',
'LVI' => 'Livingstone, Zambia - Livingstone (LVI)',
'LUN' => 'Lusaka, Zambia - Lusaka International (LUN)',
'MFU' => 'Mfuwe, Zambia - Mfuwe (MFU)',
'NLA' => 'Ndola, Zambia - Ndola (NLA)',
'KIW' => 'Southdowns, Zambia - Southdowns (KIW)',
),
'Zimbabwe' => array (
'BUQ' => 'Bulawayo, Zimbabwe - Joshua Mqabuko Nkomo (BUQ)',
'BFO' => 'Chiredzi, Zimbabwe - Chiredzi Buffalo Range (BFO)',
'VFA' => 'Victoria Falls, Zimbabwe - Victoria Falls International (VFA)',
'UTA' => 'Mutare, Zimbabwe - Mutare Grand Reef (UTA)',
'GWE' => 'Gweru, Zimbabwe (GWE)',
'HRE' => 'Harare, Zimbabwe - Harare International (HRE)',
'KAB' => 'Kariba, Zimbabwe - Kariba International (KAB)',
'MVZ' => 'Masvingo, Zimbabwe - Masvingo (MVZ)',
'VFA' => 'Victoria Falls, Zimbabwe (VFA)',
'GWE' => 'Gwert, Zimbabwe - Gweru Thornhill (GWE)',
'WKM' => 'Hwange National Park, Zimbabwe - Hwange National Park (WKM)',
),
);I put this code up as an example, I would like to know how to sort arrays alphabetically which are inside other arrays.
Thanks.