Need help receiving and listing the values of an array variable after receiving it from a form
<p>i have this in buy.php</p>

<pre><code>&lt;form action="cart.php"&gt;
    &lt;?php 
    echo'&lt;input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="' . $variety['price']. '"  /&gt;
         &lt;input name="variety[]" type="hidden" value="' . $variety['variety']. '"  /&gt;';
    ?&gt;
&lt;/form&gt;
</code></pre>

<p>Then to receive in cart.php I do it like </p>

<pre><code>&lt;?php
$aDoor= $_POST['price'];
$aDoor1= $_POST['variety'];
?&gt;
</code></pre>

<p>$aDoor is a string and $aDoor are numbers </p>

<p>to sum the numbers I can easily script it inside cart.php like: </p>

<pre><code>echo "Sum of vlues = ".array_sum($aDoor);
</code></pre>

<p>But how can I list the strings inside of $aDoor1 at the left of the prices $aDoor? and to place the sum of values script above below the $aDoor as the prices total? </p>

<p>Since $aDoor1 is an array i have use a foreach loop to list each item but then it will only print the word array instead of the actual values of the array variable $aDoor1</p>

<pre><code>foreach($aDoor1 as $variety) {
echo '&lt;div&gt;'.$variety['variety']. '&lt;/div&gt;
}
</code></pre>

<p>Thank you, Don't know that much of php</p>
