Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <input type='checkbox' value='1C-Q1-5' name='answer1[]' class='radio'>
  2.  
  3. $_POST['answer1'] //this is an array
  4.  
  5. $answers = $_POST['answer1']
  6. // we pass the fetched data first
  7. // then we transform then into a string if you want to save them in your database
  8.  
  9. $final_answers = implode("," , $answers);
  10.  
  11. //the $final_answers variable is a STRING that now holds all the chosen checkboxes but are separated by a comma
  12. //for example, it will hold a value "1C-Q1-5, 1C-Q1-2, 1C-Q1-1", if the user has checked the 1st, 2nd and 5th checkboxes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement