I have a problem when sending the value of several checkboxes through ajax.
For example I have:
<input type='checkbox' name='ids[]' class="checkBoxGroup" value='1' />
<input type='checkbox' name='ids[]' class="checkBoxGroup" value='2' />
<input type='checkbox' name='ids[]' class="checkBoxGroup" value='3' />
<input type='checkbox' name='ids[]' class="checkBoxGroup" value='4' />
<input type='checkbox' name='ids[]' class="checkBoxGroup" value='5' />
and to send it by ajax I do the following:
$.ajax({
type: "POST",
dataType: 'json',
data: { 'entrega': $("#p_entrega").val(),
'recibe': $("#p_recibe").val(),
'visto_bueno': $("#visto_bueno").val(),
'ids[]': $('[name="ids[]"]').serialize()
},
url: "<?php echo site_url();?>/reportes/acta/agregarActa",
success : function(data) {
console.log(data[0].id_acta);
}
});
But when processing it in PHP it arrives in the following way:
Array ( [0] => ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3&ids%5B%5D=4&ids%5B%5D=5 )
- Is there any way I can arrive as an arrangement?
- Is there a way to transform it into an arrangement?