title: How to use array values in another php file?
body: <p>I'm using PHP, Smarty, MySQL for my website. I have an array of error messages and I want to use this array in a PHP file to which I'm redirecting the control. However, I'm not understanding how should I achieve this.</p>
  
  <p>code is as follows:</p>
  
  <pre><code>$error_msg  = $contact_us-&gt;GetAllErrors();
  $smarty-&gt;assign('error_msg', $error_msg);
  $return_url = "view_contact_us.php?page=".$_SESSION['contact_us']."&amp;from_date={$from_date}&amp;to_date={$to_date}&amp;contact_full_name={$contact_full_name}&amp;contact_label={$hidden_contact_label}&amp;error_msg=".$error_msg;
  header("Location:".$return_url);
  </code></pre>
  
  <p>I tried many different ways, but I'm not able to use the array <code>$error_msg</code> in the file <code>view_contact_us.php</code>.</p>
  
  <p>If I print the array $error_msg it looks like following:</p>
  
  <pre><code>   Array
  (
      [error_msgs] =&gt; Please select at least one enquiry
  Please select at least one enquiry label
  )
  </code></pre>