得到最大的麻煩我有這些數組,我需要做的是讓單獨的每個數組檢查[total],然後得到bigest 5數字。我一直在嘗試,但我的頭即將爆炸,請幫助!從陣列鍵php
Array (
[0] => Array ([id] => 50 [faceid] => 1508653983 [fname] => Mario [lname] => Zelaya [email] => Email [handicap] => Handicap [province] => Province [country] => Country [gender] => male [hand] => [shot1] => Shot #1 [shot2] => Shot #2 [shot3] => Shot #3 [shot4] => Shot #4 [shot5] => Shot #5 [news] => 1 [total] => 0)
[1] => Array ([id] => 49 [faceid] => 1665349411 [fname] => Yair [lname] => Villar [email] => [email protected] [handicap] => lefthanded [province] => Buenos Aires [country] => Argentina [gender] => male [hand] => RH [shot1] => 200 [shot2] => 98 [shot3] => 98 [shot4] => 98 [shot5] => 98 [news] => 1 [total] => 592)
[2] => Array ([id] => 48 [faceid] => 1665349411 [fname] => Yair [lname] => Villar [email] => [email protected] [handicap] => lefthanded [province] => Buenos Aires [country] => Argentina [gender] => male [hand] => RH [shot1] => 500 [shot2] => 250 [shot3] => 80 [shot4] => 30 [shot5] => 20 [news] => 1 [total] => 88000)
)
我該怎麼做這些與PHP。請幫忙!!
那麼......你試了一下? – Tchoupi 2012-07-26 21:05:14
嘿,不要讓人們告訴你左手是一個障礙! – SupremeDud 2012-07-26 21:06:00
以及即時嘗試建立一個函數來取消設置everythin我不需要,只留下[total]和[userid],然後嘗試比較[total]和排序數組desc,然後只打印最後5個 – 2012-07-26 21:10:20