问题:我想要的是一个数组的pid,存不存在第二个数组里,如果少了或者多了就返回个错误。如果都有的话,第一个数组的id是第二个数组的childer的id,如果他们相等的话,将第二数组的其余的childer都去掉只保留相等的;
数组1:
Array
(
[0] => Array
(
[pid] => 47
[id] => 48
)
[1] => Array
(
[pid] => 52
[id] => 54
)
[2] => Array
(
[pid] => 55
[id] => 56
)
[3] => Array
(
[pid] => 58
[id] => 60
)
[4] => Array
(
[pid] => 63
[id] => 65
)
)
数组2:
Array
(
[0] => Array
(
[id] => 47
[pid] => 0
[type] => 2
[attribute_name] => 渠道
[childer] => Array
(
[0] => Array
(
[id] => 48
[pid] => 47
[type] => 2
[attribute_name] => 大陆国行
[price_percentage] => 2%
)
[1] => Array
(
[id] => 49
[pid] => 47
[type] => 2
[attribute_name] => 港澳台版
[price_percentage] => 2%
)
[2] => Array
(
[id] => 50
[pid] => 47
[type] => 2
[attribute_name] => 其他国家地区-无锁版
[price_percentage] => 2%
)
[3] => Array
(
[id] => 51
[pid] => 47
[type] => 2
[attribute_name] => 其他国家地区-有锁版
[price_percentage] => 2%
)
)
)
[1] => Array
(
[id] => 52
[pid] => 0
[type] => 2
[attribute_name] => 苹果保修时长
[childer] => Array
(
[0] => Array
(
[id] => 53
[pid] => 52
[type] => 2
[attribute_name] => 保修期剩余大于1个自然月
[price_percentage] => 2%
)
[1] => Array
(
[id] => 54
[pid] => 52
[type] => 2
[attribute_name] => 过保或保修期小于1个自然月
[price_percentage] => 2%
)
)
)
[2] => Array
(
[id] => 55
[pid] => 0
[type] => 2
[attribute_name] => 型号
[孩子] =>数组
(
[0] => 数组
(
[id] => 56
[pid] => 55
[类型] => 2
[属性名称] => A1863全网通
[价格百分比] => 2%
)
[1] => 数组
(
[id] =& > 57
[pid ] => 55
[类型] => 2
[属性名称] => 其他
[价格_百分比] => 2%
)
)
)
[3] =>数组
(
[id] => 58
[pid] => 0
[type] => 2
[attribute_name] => 底盘颜色
[childer] => Array
(
[0] => Array
(
[id] => 59
[pid] => 58
[类型] => 2
[属性名称] => 金色
[price_percentage] =>; 2%
)
[1] =>数组
(
[id] => 60
[pid] => 58
[类型] => 2
[属性名称] => 白色
[价格百分比] => 2%
)
[2] =>数组
(
[id] => 61
[pid] => 58
[类型] => 2
[attribute_name] => 黑色
[price_percentage] => 2%
)
[3] =>数组
(
[id] => 62
[pid] => 58
[类型] => 2
[属性名称] => 红色
[price_percentage] => 2%
)
)
)
[4] =>数组
(
[id] => 63
[pid] => 0
[type] => 2
[attribute_name] => 储量
[childer] => Array
(
[0] => Array
(
[id] => 64
[pid] => 63
[类型] => 2
[属性名称] = > 256G
[价格百分比] => 2%
)
# [1] => ( [id] => 65 [pid] => 63 [类型] => 2 [属性名称] => ; 128G [价格百分比] => 2% )[2] =>数组
(
[id] => 66
[pid] => 63
[类型] => 2
[属性名称] => 64G
[价格百分比] => 2%
)
)
)
)
##