获取数组中的某个字段
$data=
Array
(
[0] => Array
(
[goods_id] => 9
[goods_name] => zzx
[goods_price] => 5999.00
[promote_price] => 5999.00
[origion_price] => 16000.00
[is_verified] => 0
[m_id] => 2
[a_province] => 0
[a_city] => 1
[status] => 0
[is_vip] => 0
[add_time] => 1484020651
[up_time] => 1484020651
[remark] =>
[goods_photo] => http://www.daxi99.cn
[is_promote] => 0
[c_id] => 1
[goods_sn] => DX1701500010
[goods_num] => 1
[sale_num] => 0
[comment_num] => 0
[show_num] => 0
[agree_num] => 0
[goods_brief] => 111
)
[1] => Array
(
[goods_id] => 14
[goods_name] => qw
[goods_price] => 4000.00
[promote_price] => 3999.00
[origion_price] => 4500.00
[is_verified] => 0
[m_id] => 2
[a_province] => 0
[a_city] => 0
[status] => 1
[is_vip] => 0
[add_time] => 1487315990
[up_time] => 1487315990
[remark] =>
[goods_photo] => http://www.dx99.cn
[is_promote] => 0
[c_id] => 2
[goods_sn] => DX1702123123
[goods_num] => 1
[sale_num] => 0
[comment_num] => 0
[show_num] => 0
[agree_num] => 0
[goods_brief] => 1212
)
)
foreach ($data as $value) {
$val[] = $value['goods_id'];
// print_r($val);die();
}
判断某个值是否存在于数组中
in_array($goods_id,$val);