PHP traverse array with zero values
<p>I am using the following loop to traverse an array where i need both the value and the key field.</p>

<pre><code>while ($value = current($a)) {

echo "$value ".key($a).'&lt;br /&gt;';
next($a);
}
</code></pre>

<p>The problem is that the traversal only takes place till a '0' is encountered in the array as the while statement says.Is there any way i can traverse array with zero values(size of array varies) and get both value and key.</p>
