I have two dropdown option with same name like following.
<form action="" method="post">
<select name="freeoptions[]">
<option value="[7][4]">Black</option>
<option value="[7][5]">Blue</option>
<option value="[7][3]">Red</option>
</select>
<select name="freeoptions[]">
<option value="[9][11]">Small</option>
<option value="[9][15]">Large</option>
<option value="[9][13]">XL</option>
</select>
<input type="submit" name="submit" value="submit">
</form>
Now when i am posting form, getting post data in array like,
Array
(
[freeoptions] => Array
(
[0] => [7][4]
[1] => [9][11]
)
)
But I want this array something like
Array
(
[freeoptions] => Array
(
[0] => Array
(
[id] => [7]
[value] => [4]
)
[1] => Array
(
[id] => [9]
[value] => [11]
)
)
)
Can anyone please help me how to do this. Thanks,