Created
May 21, 2018 17:13
-
-
Save gianghl1983/7bac5a2a2d456ebb4108e531a61bf168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$answers = [ | |
['question_id' => 1, 'option' => 'C'], | |
['question_id' => 2, 'option' => 'A'], | |
['question_id' => 3, 'option' => 'C'], | |
['question_id' => 4, 'option' => 'B'], | |
['question_id' => 5, 'option' => 'C'], | |
['question_id' => 6, 'option' => 'C'], | |
['question_id' => 7, 'option' => 'D'], | |
['question_id' => 8, 'option' => 'D'] | |
]; | |
//B1. Chuyen $answers ve dang 'key' ==> 'value' cho de so sanh | |
$ket_qua =[]; | |
foreach ($answers as $answer ){ | |
$ketqua[$answer['question_id']] = $answer['option']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment