Guest User

Untitled

a guest
May 26th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $answers = [
  2. ['question_id' => 1, 'option' => 'C'],
  3. ['question_id' => 2, 'option' => 'A'],
  4. ['question_id' => 3, 'option' => 'C'],
  5. ['question_id' => 4, 'option' => 'B'],
  6. ['question_id' => 5, 'option' => 'C'],
  7. ['question_id' => 6, 'option' => 'C'],
  8. ['question_id' => 7, 'option' => 'D'],
  9. ['question_id' => 8, 'option' => 'D']
  10. ];
  11.  
  12. //B1. Chuyen $answers ve dang 'key' ==> 'value' cho de so sanh
  13. $ket_qua =[];
  14. foreach ($answers as $answer ){
  15. $ketqua[$answer['question_id']] = $answer['option'];
  16. }
Add Comment
Please, Sign In to add comment