在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
(转载)http://hi.baidu.com/syxrrrr/item/7dfb2387343ce0874414cfdd /* * 合并数据,如果键值相等其值相加 * @param array $descs * @param array $json_wares */ public static function getArrayMerge($descs, $json_wares) { if (is_array($descs) && is_array($json_wares)) { $arrayMerge = array(); foreach ($json_wares as $key=>$value) { if (array_key_exists($key, $descs)) { $arrayMerge[$key] = $value + $descs[$key]; unset($descs[$key]); } else { $arrayMerge[$key] = $value; } } return $arrayMerge+$descs; } else { return false; } }
|
2022-08-30
2022-08-15
2022-08-17
2022-11-06
2022-08-17
请发表评论