title: PHP passing array in session variable
body: <p>I am trying to get an array to pass in a session variable from one page to another.  I am setting the session variable equal to my the $_POST data collected from my form.  Printing the variable for test shows me that it is getting set initially on Page 1. </p>
  
  <p>Page 1</p>
  
  <pre><code>session_start(); // start up your PHP session! 
  
  if(isset($_POST['submit']))
  {
  
  
  unset($_POST['submit']);
  $_SESSION['userdata'] = $_POST;
  $userqty=$_POST;
  print_r($_SESSION['userdata']);
  </code></pre>
  
  <p>On Page 2 I am trying to set it equal to another variable.  Again I test to see if the array has passed to page 2 but it doesn't and I get an error for not having a valid array for the <strong>array_sum</strong> function</p>
  
  <p>session_start(); // start up your PHP session! </p>
  
  <pre><code>$_SESSION['userdata'] = $userqty;
  
  print_r($_SESSION['userdata']);
  
  print_r($userqty;);
  
  $userqty_total=array_sum($userqty);
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>