title: Turn a string into an array using PHP
body: <p>My session variables are </p>
  
  <pre><code>$_SESSION["listofIds"]=163,164;
  $_SESSION["listofVals"]=4,3;
  </code></pre>
  
  <p>I want to select session values like </p>
  
  <pre><code>$_SESSION["listofIds"][0]=163;
  $_SESSION["listofIds"][1]=164; 
  $_SESSION["listofVals"][0]=4;
  $_SESSION["listofVals"][1]=3;
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>echo $_SESSION["listofIds"][0]; 
  </code></pre>
  
  <p>then it prints '1' i.e. first character. How can I handle this? </p>
  
  <p>Also how can I get 1st element of <code>$_SESSION["listofIds"]</code> and 1st element of <code>$_SESSION["listofVals"]</code> after placing in while loop for mysql query.</p>