Because this is invalid:
$_POST[child[$count]]
What exactly are you trying to access? See, in your code, you have
child[$count], which means you're treating the word 'child' like an array variable. It's not a variable, it's just a string literal.
If $child is an array, and the value of $child[$count] is the index you want to access in the $_POST array, your code would make sense.
The way I figure it, $_POST['child'] is an array, and you want to access the $count index of that array.
That's written like this:
$_POST['child'][$count]
Bear in mind that you cannot access nested array indexes within double-quoted strings using the regular variable substitution. Suppose $count is 3 in the following line of code:
echo "it is $_POST[child][$count]."
This will print "it is Array[3]."
The reason is that $_POST['child'] is evaluated as an array. Since it's not a string (or can be converted to string), PHP substitutes the word "Array" for it's value. The next square bracket is echoed as a literal character, then $count is substituted with it's value, 3, and finally, the last square bracket character is printed.
You either need to use curly-brace syntax in your string, or close your string and concatenate your variable:
1) echo "It is {$_POST['child'][$count]}.";
2) echo "It is " . $_POST['child'][$count] . ".";
I prefer the first way. Notice that within curly-braces, you must quote all string indexes just as you would when accessing an array index from outside of a string.
Here are some links to the manual relevant to your problems:
http://www.php.net/types.string
http://www.php.net/types.array
Take care,
Nik
http://www.bigaction.org/