I have an array of inputs similar to below
<input name="attr[]" value = "a" type="text" />
<input name="attr[]" value = "b" type="text" />
<input name="attr[]" value = "c" type="text" />
On the server side I am using a foreach loop to fetch the value entered. However, I want the values a ,b and c as well. How do i do that in PHP?
I did something like this but its not working for me. The $key returned is just an index.
foreach($_POST['attr'] as $key=>$val)
{
//process each $key and $val
}