I try to get a PHP array like this
array(
color => array("blue", "red", "yellow", "pink"),
size => array("small", "medium, "large"),
width => array("30", "32, "34"),
);
The data is posted from a HTML form like below
<form method="post" action="post.php">
<input type="text" name="data[color][]" value="red"/>
<input type="text" name="data[color][]" value="blue"/>
<input type="text" name="data[size][]" value="small"/>
<input type="text" name="data[width][]" value="30"/>
<input type="text" name="data[width][]" value="32"/>
</form>
The problem is that only the last items are posted in the array. The output from the array is
array(
color => array("blue"),
size => array("small"),
width => array("32"),
);
Is there something missing in my form why this is happening?