首先我是這個網站的新手,這是一個很大的幫助,所以在此先感謝您的意見。PHP如何移動數組的子集來做類似asort的事情?
我想在比較它們後像移動一樣移動數組值的子集。
以下是我有:
$array[name] = "name";
$array[date] = "date";
$array[item1] = 7;
$array[item2] = 16;
$array[item3] = 3;
$array[item4] = 16;
$array[item5] = 2;
$array[item6] = 10;
$array[author] = "author";
$array[location] = "location';
我想通過這樣的「16」的值在子集的最終排序值的itemsN值進行排序,而不是「16其他的值「在子集的開始。
所以那種我想直到結束後:
$array[name] = "name";
$array[date] = "date";
$array[item1] = 7;
$array[item2] = 3;
$array[item3] = 2;
$array[item4] = 10;
$array[item5] = 16;
$array[item6] = 16;
$array[author] = "author";
$array[location] = "location';
能$陣列 - >項目僅僅是一個數組?這樣你可以使用PHP的本地函數進行排序。 – HoLyVieR 2010-07-19 19:35:35
看起來更像對象屬性而不是數組 – 2010-07-19 19:43:10
是的,它是一個數組。我編輯了這個問題來反映這一點。 – netefficacy 2010-07-20 18:46:24