There is such Html:

<input type="checkbox" name="type[]" value="100"> 

When a form is serialized, the name type [] is entered in the field, encoded with special characters and there are two types :

 type%5B%5D=19&type%5B%5D=2 

Serialization itself:

 var formData = $(element).closest('form').serialize(); console.log(formData); 
  • 2
    All right On the server, get an array in $ _POST ['type'] - Deonis
  • The nonsense comes to the server like this: string (236) "type [] = 19 & type; [] = 2 & type; [] = 3 & subject = s1 & message = s2 - Jony
  • I would be surprised if there was something else. parse_str ($ _ POST ['formData'], $ arrData); var_dump ($ arrData); - Deonis
  • Now we’ll check ... with parse_str there was also a similar trabl - Jony
  • one
    @Oleg Ponomarchuk, in mysticism, and especially in terms of programming, I do not believe. If we check these two checkboxes, and transfer them with an ajax request, we get the following array: array (1) {["type"] => array (2) {[0] => string (2) "19" [1 ] => string (1) "2"}} - Deonis

0