私は多次元配列を持っています
Array(
[0] => Array
(
[category_id] => 1
[question_id] => 1
[option_id] => 2
[title] => Do you wear glasses?
[answer] => no
)
[1] => Array
(
[category_id] => 1
[question_id] => 2
[option_id] => 3
[title] => Your hobbies ?
[answer] => movies
)
[2] => Array
(
[category_id] => 1
[question_id] => 4
[option_id] => 8
[title] => what is your status?
[answer] => single
)
[3] => Array
(
[category_id] => 1
[question_id] => 2
[option_id] => 1
[title] => Your hobbies ?
[answer] => travel
)
)
2 番目と 4 番目の配列に同じ質問 (同じカテゴリ ID と同じ質問 ID) が含まれている場合、同じカテゴリ ID と質問 ID を持つ配列を結合したいと考えています。
私が期待しているのはこれです
Array(
[0] => Array
(
[category_id] => 1
[question_id] => 1
[option_id] => 2
[title] => Do you wear glasses?
[answer] => no
)
[1] => Array
(
[category_id] => 1
[question_id] => 2
[option_id] => 3
[title] => Your hobbies ?
[answer] => movies,travel
)
[2] => Array
(
[category_id] => 1
[question_id] => 4
[option_id] => 8
[title] => what is your status?
[answer] => single
)
)
手段はその答えだけを組み合わせます。助けてください ...