我目前有一個值的關聯數組,我需要根據另一個數組中的值進行排序。PHP基於數組值的排序關聯數組
實施例:
如果我有值的, AssocArray = '122'=> '12', '123'=> '32', '232'=> '54',「343的陣列「=>」 12'
我需要檢查它針對值的另一個數組, orderArray =‘232’,‘123’
如果它存在的值時,則推到AssocArray的頂部。所以最終的數組看起來像這樣。
AssocArray = '232'=> '54', '123'=> '32', '122'=> '12', '343'=> '12'
抱歉,我沒有任何工作代碼,我仍然在學習PHP。
任何幫助將真正感謝:)謝謝。
看看這裏:HTTP ://stackoverflow.com/questions/777597/sorting-an-associative-array-in-php –