我有一个这种形式的数组:
$parray[]=array('item_id'=>$rs->fields['item_id'],
'item_name'=>$rs->fields['item_name'],
'item_count' =>$cs->fields['item_count'],
'item_link'=>$rs->fields['item_link']);
并在一个循环中设置值。所以,我把它们放在 $parray[0], $parray[1]...
现在,如何在 item_count 上对这个数组进行排序?
例如:
$parray[0] = 0, "hello", 5, www.abc.abc
$parray[1] = 1, "hello2", 7, www.abc.abcab
$parray[2] = 2, "hello1", 8, www.abc.abca
$parray[3] = 3, "hello3", 2, www.abc.abcaaa
结果应该是
$parray[0] = 2, "hello1", 8, www.abc.abca
$parray[1] = 0, "hello", 5, www.abc.abc
$parray[2] = 1, "hello2", 3, www.abc.abcab
$parray[3] = 3, "hello3", 2, www.abc.abcaaa
我怎么能做到这一点?
谢谢