問題:我想要的是一個陣列的pid,存不存在第二個陣列裡,如果少了或多了就回傳個錯誤。如果都有的話,第一個數組的id是第二個數組的childer的id,如果他們相等的話,將第二數組的其餘的childer都去掉只保留相等的;
數組1 :
Array
(
[0] => Array
(
# [pid] =
## # [pid] =## # [pid] =
### [id] => 48
)
[1] =>. [pid] => 52
[id] => 54
)
# [2] => ## (
[pid] => 55
## [pid] => 56626# # ] => Array
(
[pid] => 58
# [4] => Array
(
[pid] => 63
#)
)
陣列2:
Array
(
[0] = > Array
(
[id] => 47
1p [pid] =
## =# 1pid] =#
## [attribute_name] => 管道 [childer] => Array# [0] => Array ( [pid] => 47 [type] =& 2[attribute_name] => 大陸國行
[price_percentage] => 2%
)
(
[id] => 49
pid] => 47 [type] => 2# ; 港澳台版
[price_percentage] => 2%
)
(
[id] => 50
[pid] => 47
[type] => 2
# gt; 其他國家地區-無鎖定版 [price_percentage] => ; 2% ) ( [id] => 51 [pid] => 47## [attribute_name] =>其他國家與鎖定版本
[price_percentage] => 2%
## ))
[1] => Array
## (# # #
## [pid] => 0 [type] => 2 [childer] = > Array ( [0][id] => 53
pid] => 52
[type] => 2
# ; 保固期剩餘大於1個自然月 [price_percentage] => ; 2% ) ( [id] => 54 [pid] => 52## 與 [attribute_name] => 保固化或保固期小於1個自然月
[price_percentage] => 2%
)
)
## [2] => Array
(
[id] => 55
## ## [type] => 2
[attribute_name] => 型號
[兒童] =>陣列
(
[0] => [id] => 56
## 55 [型別] => 2 > 2## 2
# [price_percentage] => 2%[1] => 陣列
[id] => ; 57
[pid ] => 55
[種] => 2
_ [price_per百分比] => 2%
#
# ) ) [3] =>數組 ( [id] => 58 [pid] =># [attribute_name] => 身體顏色
[childer] => Array
## ) (
# ( [id] => 59[pid] => 58
[型別] => 2
[物件名稱] =>金子
[price_percentage] =>; 2%
)
陣列
(
[pid] => 58
勾選[attribute_name] => 白
[price_percentage] => 2%# ##
[2] =>陣列 ( [pid] => 58 勾選[attribute_name] => 黑色 [price_percentage] => 2%# ## [price_percentage] => 2%# ## #[3] =>陣列
(
[pid] => 58
[型別] => 2
[物件名稱] =>紅色
[price_percentage] => 2%
)
# [4] =>陣列
(
[id] => 63
[pid] =>
# [attribute_name] => 儲量 [childer] => Array## [id] => 64
[pid] => 63
[屬性名稱] = > 256G
## price_percentage] => 2% ) ( [id] => 65 [pid] => 63 [屬性名稱] => ; 128G 2% )[2] =>陣列
(
[pid] => 63
勾選[attribute_name] => 64G
[price_percentage] => 2%
## ## ) # ))