Greetings:
I am a newbie to this forum. I am having a problem accessing the individual elements in a form array. For example, below is a simple example:
The form contains the following
<input type="text" name="material[0]" />
<input type="text" name="material[1]" />
<input type="text" name="material[2]" />
<input type="text" name="material[3]" />
So I have the array material that is numerically indexed. Now when I do a phpinfo(0), the result shows:
POST["material"] Array
(
[0] => 65
[1] => 8
[2] => 8
[3] => 15
)
Now, the problem I am having is I cannot access each individual value in the material array. For example, here is my simplified code;
$i=0;
while ( $i < 4 ) {
$material=$_POST['material[$i]'];
$i++;
}
when I print $material within the loop, it is empty.
I then tried this:
$i=0;
while ( $i < 4 ) {
$material=$_POST['materia'][$i]];
$i++;
}
Again, nothing???
Thanks in advance