title: Sending array or session values in PHP mail
body: <p>I have a session array that I want to send the contents of in an email body.</p>
  
  <p><code>$_SESSION['order']</code> is my session value and <code>print_r[$_SESSION['order']]</code> gives me output like the following:</p>
  
  <pre><code>Array 
  ( 
      [0] =&gt; Array 
             ( 
                 [0] =&gt; product one 
                 [1] =&gt; 1 
             ) 
      [1] =&gt; Array 
             ( 
                 [0] =&gt; product two 
                 [1] =&gt; 1 
             ) 
      [2] =&gt; Array 
             ( 
                 [0] =&gt; product three 
                 [1] =&gt; 1 
             ) 
  ) 
  </code></pre>
  
  <p>This session value I have is a 2D array and I need get this session data.</p>
  
  <p>Here's what I have in my email body:</p>
  
  <pre><code>$Body="&lt;b&gt;Oder Details&lt;/b&gt;  
  &lt;table&gt; 
  foreach($order as $row)  
  {  
  echo '&lt;tr&gt;';  
  echo '&lt;td&gt;$row[0]&lt;/td&gt;';  
  echo '&lt;td&gt;$row[1]&lt;/td&gt;';  
  echo '&lt;/tr&gt;';  
  }  &lt;/table&gt;"
  </code></pre>
  
  <p>But all I am getting in the email is blank except for this text:</p>
  
  <pre><code>Order Details   
  foreach(Array as ) {
  }
  </code></pre>
  
  <p>Why am I getting blank emails even though <code>$_SESSION</code> contains values? Is my foreach loop wrong?</p>