How to use a comma-delimited string in a shopping cart array
<p>I'm building a shopping cart php file that will query a database for products (and the quantity of each product a user adds to the shopping cart). But I'm having trouble understanding what to do with a "comma-delimited string". Here's the loop in my code so far:</p>

<pre><code>//Loop through your cart array (foreach productID's quantity in cart):
     $_SESSION['numItems'] = $cart;//Update the number of items in your cart

     //Build a comma-delimited string in $prodIDStr containing the product
     //ID’s of the products currently in our cart array:
     $prodIDStr = "";//STACKOVERFLOW QUESTION


     if($_SESSION[numItems] = 0){//If cart it empty:
         print "&lt;h3&gt;Your shopping cart is empty!&lt;/h3&gt;\n";
     }
     Else{//if cart is not empty:

         //remove trailing comma from $prodIDstr:
</code></pre>

<p>What exactly is a comma-delimited string, and what does removing a trailing comma do?</p>
