您好,欢迎来到爱站旅游。
搜索
您的当前位置:首页PHP 根据指定的key,获取对应的值

PHP 根据指定的key,获取对应的值

来源:爱站旅游
//如:数组
$childSku = Array
(
    [parent_id] => 0
    [product_is_multi] => 1
    [parent_sku] => SJ00442
    [sku] => SJ00442-01
    [siteid] => 15
    [currency] => AUD
    [ebay_account_id] => 94
    [opration_id] => 1
    [quantity] => 12.5700
    [start_price] => 12.5700
    [ean] => Does Not Apply
    [isbn] => Does Not Apply
    [upc] => Does Not Apply
    [image_galleries] => a:3:{i:0;s:66:"http://120.78.243.154/upload/image/productImages/1488942810747.jpg";i:1;s:66:"http://120.78.243.154/upload/image/productImages/1488942370385.jpg";i:2;s:66:"http://120.78.243.154/upload/image/productImages/1488942384287.jpg";}
)
//获取指定key的值:
$needKey = ['quantity','start_price','ean','isbn','upc','image_galleries'];
//处理:array_intersect_key  //使用键名比较计算数组的交集
$needArr = array_intersect_key($childSku,array_flip($needKey));

 

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- azee.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务