How to store a single array value into a session variable? I have 

Array ( [0] =&gt; cid [1] =&gt; TN201501HP ) 


Now I want to store "TN201501HP" into some session variable. How to store this value to a session variable?
&lt;?php
//If you want store the value in a session, you need first start the session
session_start();
//I suposse that your array is named $array,
//then if you want get the position 1 use the following line
$_SESSION['var'] = $array[1];
//checking the stored value
echo $_SESSION['var'];

?&gt;


Output:


  TN201501HP