title: How to append data in session variable in php?
body: <p>I'm developing shopping cart application. In this selected product ids are stored in session variable. If user wants to add another products in the cart he will click on <strong>Add More...</strong> button. I want to append selected product's ids in same session variable.</p>
  
  <p>My code is:</p>
  
  <p>shop_details_cart.php</p>
  
  <pre><code>$get_ids = $_GET['ids']; 
  $ids =  json_decode($get_ids,true);
  $id_string = implode(',', array_map(function ($entry) {
   return $entry['id'];
  }, $ids));
  //$_SESSION['ids'];
  //array_push($_SESSION['ids'],$id_string);
  $_SESSION['ids']=$id_string;
  $sql=mysql_query("select product_id,name,stock from $shop_loc where product_id IN($_SESSION[ids])");
  </code></pre>