Did you guys know this? Check out this little web page
test.php:
<?php
print_r($_POST);
?>
<form action="test.php" method="post">
<input type="text" name="1[][seq]" value="1" /><br/>
<input type="text" name="1[][seq]" value="5" /><br/>
<input type="text" name="1[][seq]" value="nada" /><br/>
<input type="submit" value="Submit"/>
</form>
Here’s the fun bit: the "[]" thing in there will correctly add elements to the array so if you submitted this form, you’d get something like this:
Array ( [1] => Array ( [0] => Array ( [seq] => 1 ) [1] => Array ( [seq] => 5 ) [2] => Array ( [seq] => nada ) ) )
BUT... that only works if the "[]" has zero or one space. If you use 2 or more blank spaces, it gets treated as an array key, and only the last item survives the form posting:
Array ( [1] => Array ( [ ] => Array ( [seq] => nada ) ) )
Neat, eh? I thought’d I’d share.