I have a foreach statement that successfuly pulls the info from an array, but now I need to add a number for each time it checks the associative array, here is my code

PHP Code:
echo "<p><h1>Products Array Loop thru contents</h1></p>";          
           
$process_button_string zen_draw_hidden_field('p''theoutletseason');
           foreach (
$productArray as $product){

                while (list(
$k$v) = each ($product)) {
               
//echo "$k ... $v <br/>";
               
$process_button_string .= zen_draw_hidden_field($k,$v);
               }       
           }

               echo 
"Process Button String :$process_button_string";
            
            
// test session ID
             
echo "<p>Your session ID is ".session_id().".</p>"
The above works fine and outputs:

HTML Code:
<input type="hidden" name="p" value="theoutletseason" />
<input type="hidden" name="productsImage" value="https://www.store.com/store/images/HP-E6930p.jpg" />
<input type="hidden" name="productsName" value="Hewlett Packard HP-E6930p Business Laptop" /><input type="hidden" name="quantityField" value="5" />
<input type="hidden" name="productsPrice" value="$2,900.00" />
<input type="hidden" name="productsPriceEach" value="$580.00" />
<input type="hidden" name="id" value="2" />
<input type="hidden" name="productsImage" value="https://www.store.com/store/images/HP-E6930p.jpg" />
<input type="hidden" name="productsName" value="Hewlett Packard HP-E6920p Business Laptop" />
<input type="hidden" name="quantityField" value="1" />
<input type="hidden" name="productsPrice" value="$560.00" />
<input type="hidden" name="productsPriceEach" value="$560.00" />
<input type="hidden" name="id" value="1" />
<p>Your session ID is f9b5f16d3f3e5ec0a604b570b5d0c2d8.</p>
what I need is some modification to output this source code instead:

HTML Code:
<input type="hidden" name="p" value="theoutletseason" />
<input type="hidden" name="productsImage0" value="https://www.store.com/store/images/HP-E6930p.jpg" />
<input type="hidden" name="productsName0" value="Hewlett Packard HP-E6930p Business Laptop" />
<input type="hidden" name="quantityField0" value="5" /><input type="hidden" name="productsPrice0" value="$2,900.00" />
<input type="hidden" name="productsPriceEach0" value="$580.00" />
<input type="hidden" name="id" value="2" />
<input type="hidden" name="productsImage1" value="https://www.store.com/store/images/HP-E6930p.jpg" />
<input type="hidden" name="productsName1" value="Hewlett Packard HP-E6920p Business Laptop" />
<input type="hidden" name="quantityField1" value="1" />
<input type="hidden" name="productsPrice1" value="$560.00" />
<input type="hidden" name="productsPriceEach1" value="$560.00" />
<input type="hidden" name="id" value="1" />
<p>Your session ID is f9b5f16d3f3e5ec0a604b570b5d0c2d8.</p>