-2
我想我的關聯數組有它的元素排序。目前,我的數組是這樣的:排序一個PHP關聯數組
Array
(
[1585] => Chicago, Ohio,Dallas, Denver, Detroit, Houston, Las Vegas, So. Calf.
[1586] => Chicago, Ohio, Dallas, Denver, Houston, Las Vegas, So. Calf.
[1588] => The Bay Area, Chicago, Dallas, Detroit, Houston, Las Vegas, Minneapolis
[1589] => Charlotte, Chicago, Ohio, D.C.
[1590] => Orange County, Orlando, Philadelphia, Phoenix, Richmond, San Diego, The Bay Area, Seattle
)
而我想這個數組以升序排列,這樣的:
Array
(
[1585] => Chicago, Dallas, Denver, Detroit,Houston, Las Vegas, Ohio, So. Calf.
[1586] => Chicago, Dallas, Denver, Houston, Las Vegas,, Ohio, So. Calf.
[1588] => Chicago, Dallas, Detroit, Houston, Las Vegas, Minneapolis, The Bay Area
[1589] => Charlotte, Chicago, D.C., Ohio
[1590] => Orange County, Orlando,Philadelphia, Phoenix, Richmond,San Diego, Seattle, The Bay Area
)
感謝....
你的代碼是什麼,它產生的錯誤信息是什麼? – 2012-01-07 04:18:56
你嘗試過什麼嗎?嘗試通過逗號分割每個元素,該元素返回數組然後進行排序,然後合併結果。那是你的答案。 – DarthVader 2012-01-07 04:21:17