Getting $_POST values from array of input elements
<p>I have an array of inputs similar to below</p>

<pre><code>&lt;input name="attr[]" value = "a" type="text" /&gt;
&lt;input name="attr[]" value = "b" type="text" /&gt;
&lt;input name="attr[]" value = "c" type="text" /&gt;
</code></pre>

<p>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?</p>

<p>I did something like this but its not working for me. The <code>$key</code> returned is just an index.</p>

<pre><code>foreach($_POST['attr'] as $key=&gt;$val)
{
   //process each $key and $val
}
</code></pre>
