1
的結果我想下面的兩個數組比較:比較兩個數組找到評估
Array
(
[0] => stdClass Object
(
[question_id] => 1
[answer_id] => 21
)
[1] => stdClass Object
(
[question_id] => 3
[answer_id] => 33
)
[2] => stdClass Object
(
[question_id] => 3
[answer_id] => 36
)
[3] => stdClass Object
(
[question_id] => 3
[answer_id] => 38
)
[4] => stdClass Object
(
[question_id] => 6
[answer_id] => 49
)
)
Array
(
[0] => stdClass Object
(
[question_id] => 3
[answer_id] => 38
)
[1] => stdClass Object
(
[question_id] => 3
[answer_id] => 37
)
[2] => stdClass Object
(
[question_id] => 3
[answer_id] => 33
)
[3] => stdClass Object
(
[question_id] => 1
[answer_id] => 22
)
[4] => stdClass Object
(
[question_id] => 6
[answer_id] => 49
)
)
一個陣列是正確的答案,評估,另一種是用戶輸入的內容。
如何比較這兩個數組產生另一個顯示question_id以及布爾值是否他們得到它的權利?
我目前遇到以下問題:
- 一些問題有多個答案給他們。
- question_id的順序是不一樣的,正確的順序是第二個數組並不總是以數字順序排列。