php查找数据放在数组里,如何在数组中搜索并取出想要的数据

1.比如我有一堆数组如下:

Array

(

[0] => Array

(

[gid] => 1

[cid] => pc001

[class] => 办公用品

[name] => 笔记本电脑

[type] => Acer Aspire E1-410G

[unit] => 台

[num] => 1

[price] =>

[amount] =>

[invoice] =>

[bremarks] =>

[bid] =>

)

[1] => Array

(

[gid] => 2

[cid] => pc002

[class] => 办公用品

[name] => 笔记本电脑

[type] => Acer Aspire E5-571G-58WT

[unit] => 台

[num] => 2

[price] =>

[amount] =>

[invoice] =>

[bremarks] =>

[bid] =>

)

[2] => Array

(

[gid] => 4

[cid] => wf123

[class] => 办公用品

[name] => 鼠标

[type] => 罗技M90

[unit] => 个

[num] => 3

[price] =>

[amount] =>

[invoice] =>

[bremarks] =>

[bid] =>

)

[3] => Array

(

[gid] => 6

[cid] => wf012

[class] => 办公用品

[name] => 电脑键盘

[type] => PS接口

[unit] => 个

[num] => 4

[price] =>

[amount] =>

[invoice] =>

[bremarks] =>

[bid] =>

)

)

2.搜索条件如下:gid等于如下数组

Array

(

[0] => 3

[1] => 4

[2] => 5

)

3.我如何把gid=3,4,5的数据取出来呢?

如上数据应该只有一条符合要求,求大神帮忙~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值