I'm not really sure if the Title was correct. The actual application is a quiz. Ok let me illustrate this and here's my sample snippet.
<form method="POST">
Softdrinks:
<div class="checkbox">
<label><input type="checkbox" name="question[1]answer[]" value="Coke">Coke</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="question[1]answer[]" value="Royal">Royal</label>
</div>
Coffee :
<div class="checkbox">
<label><input type="checkbox" name="question[2]answer[]" value="Cappuccino">Cappuccino</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="question[2]answer[]" value="Latte">Latte</label>
</div>
<button type="submit">Submit</button>
</form>
Let's assume that all of the options are checked. But when the form submitted, The output was something like this:
"question":{
"1":"Coke",
"2":"Cappuccino"
}
So the "Royal" and "Latte" are skipped and i don't know why. I want the output should be like this :
"question":[
"1": {
"Coke",
"Royal"
}
"2": {
"Latte",
"Cappuccino"
}
]