php - Converting tickboxes in a form to any array in $_POST -


What's the best way to collect data from the form using the checkbox, so it's well worth the $ _POST For example, in my form I will have HTML which looks like this (x = tick):

  [x] option is a [] option two [X ] Option three  

which I want to translate from an array of $ _POST to an array:

  array ([a] => option one "[B] = & gt;" Option three ")  

Is there a good shortcut to do this?

Post-document "itemprop =" text ">
  & lt; input type =" checkbox "name =" tick box [a] "value =" option one "check =" check "& gt; & lt ; Input type = "checkbox" name = "tick box [b]" value = "option two" & gt; & gt; input type = "checkbox" name = "tick box [c]" value = "option three" check = "Check" & gt;  

yields

  array ([A] => "option one", [c] = & gt; "Option three",)  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -