マスターの皆さん、この配列比較の対処法を教えてください。
小萝卜头
小萝卜头 2020-06-30 16:33:24
0
0
1045

質問: 配列の pid が必要です。それは 2 番目の配列に存在しますか? それより小さいか大きい場合は、エラーが返されます。両方がある場合、最初の配列の ID は 2 番目の配列の子の ID です。それらが等しい場合は、2 番目の配列の残りの子を削除し、等しいものだけを保持します。

配列 1 :

配列

(

[0] =>配列

(

[pid] =>47

[ID] = & gt; 48

##)

# [1] = & GT; 配列

## (

## [ pid] => 52

[id] => 54

)

# [2] => 配列

# (

by] => array

# [4] => array

)[ pid] => 63

[id] => 65

)

)

配列 2:

Array

(

[0] = & gt; 配列

(

[ID] = & gt; 47

## [pid] = & gt; 0

## [type] = & gt

(

[ID] = & GT; 48

## [Pid] => 47

## [type] => 2

# [aTtribute_name] =>中国銀行

[Price_percentage] => 2%

[id] => 49

pid] => 47

[pid] =>47

[price_percentage] => ; 2%

‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ [id] => 51

[Pid] = & GT; 47

## [タイプ] = & GT; 2

# #[attribute_name] =&gt [price_percentage] => 2%

##

)

# [1] => 配列

(

) [id] => 52

[pid] = & gt; 0

[Type] = & GT; 2

## [Attribute_name] = & GT 保証時間

[Childer] = > 配列

' ' way ‐ ‐ ‐ P P P L P L P T P L M L P & T; [id] => 53

pid] = & gt; 52

[タイプ] = & GT; 2

## [Attribute_name] = & GT; ; 2%

‐ ‐ ‐ ‐ to ‐ ‐ 1 1 [id] => 54

## #] =>保証または保証期間が1つ未満です

# [2] => array

[id ] => 55

[pid] => 0

[子供] =>配列

(

[0] => 配列

(

[id] => 56

[pid] => 55

[type] => 2

[attribute_name] => A1863全网通

[price_percentage] => 2%

)

[1] => 配列

(

[id] => 57

[pid ] => 55

[type] => 2

[attribute_name] => その他

[価格_パーセント] => 2%

)

)

)

[3] =>配列

(

[id] => 58

[pid] => 0

[type] => 2

[attribute_name] => 机身颜色

[子] => Array

(

[0] => Array

# # (

[id] => 59

[pid] => 58

[タイプ] => 2

[attribute_name] =>金色

[price_percentage] => 2%

)

[1] =>配列

(

[id] => 60

[pid] => 58

[タイプ] => 2

[attribute_name] => 白色

[price_percentage] => 2%

)

[2] =>配列

(

[id] => 61

[pid] => 58

[タイプ] => 2

[attribute_name] => 黑色

[price_percentage] => 2%

)

[3] =>配列

(

[id] => 62

[pid] => 58

[タイプ] => 2

[attribute_name] =>色

[price_percentage] => 2%

)

)

)

[4] =>配列

(

[id] => 63

[pid] => 0

[type] => 2

[attribute_name] => 保存容量

[子] => Array

(

[0] => Array

(

[id] => 64

[pid] => 63

[type] => 2

[属性名] = > 256G

[price_percentage] => 2%

)

[1] => 配列

(

[id] => 65

[pid] => 63

[type] => 2

[属性名] => ; 128G

[price_percentage] => 2%

)

[2] =>配列

(

[id] => 66

[pid] => 63

[タイプ] => 2

[attribute_name] => 64G

[price_percentage] => 2%

)

)

)

)

小萝卜头
小萝卜头

全員に返信(0)
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート