[請益] 陣列取值並計算數量

看板PHP作者 (Ann)時間11年前 (2012/10/13 00:44), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/3 (看更多)
各位前輩好 我在修改書上範本的頁面時碰到了一個問題想請教前輩 就是... 以下這個陣列 我想取出GoodsKind=8的陣列存成新的陣列並計算數量 我要用哪個函數才對呢? $Goods=Array( [0]=>Array([GoodsID]=1 [GoodsUrl]=>http://xxx.xxx.xxx [GoodsKind]=>8) [1]=>Array([GoodsID]=2 [GoodsUrl]=>http://xxx.xxx.xxx [GoodsKind]=>12) [2]=>Array([GoodsID]=3 [GoodsUrl]=>http://xxx.xxx.xxx [GoodsKind]=>8) ) 先感謝各位前輩的幫忙囉! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.44.10.135

10/13 01:55, , 1F
array_filter()
10/13 01:55, 1F

10/13 02:42, , 2F
DONE 等等順便分享上來給大家~
10/13 02:42, 2F

10/13 02:42, , 3F
感謝一樓的大大
10/13 02:42, 3F
文章代碼(AID): #1GU4ZR1j (PHP)
文章代碼(AID): #1GU4ZR1j (PHP)