title: how to print the session array variable values in another page in php
body: <p>this is the program to print the all subject name which are the field name of the student table.i stored the all subject name into an array and i have to print that array values in that another page.so i stored that array into session variable but while to print that array in next page it print only as "Array".</p>
  
  <pre><code>&lt;?php
  
  session_start();
  $con=mysql_connect("localhost","root","");  
  mysql_select_db("cse",$con);
  
  $sql="select * from studenttable where username='saravanan'";
  
  $calname=array();
  $i=0;
  mysql_query($sql);
  while($rs=mysql_fetch_field($result))
  {
           $colname[$i]=$rs-&gt;name;
           $i++;
  
  
  }
  $_SESSION['subject']=$calname;
  ?&gt;
  
  
  in the next page i print the session variable using 
  
  
  &lt;?php
  session_start();
  echo $_SESSION['subject'];
  ?&gt;
  
  but i am getting "Array"only as output.
  how to print the all value of array what i stored into it already?
  </code></pre>