foreach ($items as $product ) {
echo $product;
?><input type="text" size="2" value="<?php
\\display quantity here
?>" name="quantity" /><?php
}
$items is an array. It has multiple values, some duplicate. How do i count the duplicate values in the array and display in this foreach loop?
i know array_count_values($product) but putting that in the foreach loop won't accomplish what i want.
another thing. i can get the foreach loop to not display duplicates by doing this
foreach (array_unique($items) as $product ) {
echo $product;
?><input type="text" size="2" value="<?php
\\display quantity here
?>" name="quantity" /><?php
}
how would i accomplish both.
basically i want it to display the quantity without displaying duplicate rows. aka shopping cart.