2014-04-01 399 views
1

我想按排序的最高值排序我的數組順序。按最大值對數組排序

這是一個JSON數據

"score":[ 
    { 
     "userId":"5", 
     "playtime":"1396369254", 
     "score":"25" 
    }, 
    { 
     "userId":"1", 
     "playtime":"1396369056", 
     "score":"12" 
    }, 
    { 
     "userId":"2", 
     "playtime":"1396369240", 
     "score":"100" 
    } 
], 

這裏得分100將

+1

你嘗試過什麼第一指標?你看過[用於排序數組的PHP文檔](http://www.php.net/manual/en/array.sorting.php)嗎? – Jeff

回答