2013-11-15 7 views
0

주어진 배열을 날짜에 정렬해야합니다. array_multisort를 사용해 보았지만 정렬 할 수는 없었습니다. 어느 것이 더 적절한 usort 또는 array_multisort인가?PHP에서 다차원 배열을 정렬하는 방법?

Array 
(
    [165953] => Array 
     (
      [0] => Array 
       (
        [wallet_transaction_id] => 165953 
        [wallet_currency_id] => 2 
        [description] => updating SC Dollars by 100.00 from PSM product transaction. 
        [amount] => 100.00 
        [date] => 2013-11-13 08:08:05 
       ) 

      [1] => Array 
       (
        [wallet_transaction_id] => 165953 
        [wallet_currency_id] => 3 
        [description] => updating Spy Points by 50.00 from PSM product transaction. 
        [amount] => 50.00 
        [date] => 2013-11-13 06:08:05 
       ) 

     ) 

    [165952] => Array 
     (
      [0] => Array 
       (
        [wallet_transaction_id] => 165952 
        [wallet_currency_id] => 2 
        [description] => updating SC Dollars by 100.00 from PSM product transaction. 
        [amount] => 100.00 
        [date] => 2013-11-13 05:02:11 
       ) 

      [1] => Array 
       (
        [wallet_transaction_id] => 165952 
        [wallet_currency_id] => 3 
        [description] => updating Spy Points by 50.00 from PSM product transaction. 
        [amount] => 50.00 
        [date] => 2013-11-13 08:02:11 
       ) 

     ) 
) 
+0

결과를 어떻게 보이시겠습니까? 나는 배열의 각 요소 ('165953'와'165952')를 가정하고 배열을 정렬하고 싶습니다 ... 맞습니까? –

+0

사본입니다. 첫 번째 대답은 가장 현명하고 속도가 좋은 방법입니다. – Alex

+0

배열이 업데이트됩니다. – shiv

답변

관련 문제