I am a newbie to this forum. I am haing a problem accessing the individual elements in a form array. For example, below is a simple example:
The form contains the following
Code: Select all
<input type="text" name="material[0]" />
<input type="text" name="material[1]" />
<input type="text" name="material[2]" />
<input type="text" name="material[3]" />
Code: Select all
POST["material"] Array
(
[0] => 65
[1] => 8
[2] => 8
[3] => 15
)
Code: Select all
$i=0;
while ( $i < 4 ) {
$material=$_POST['material[$i]'];
$i++;
}
I then tried this:
Code: Select all
$i=0;
while ( $i < 4 ) {
$material=$_POST['materia'][$i]];
$i++;
}
Thanks in advance