title: Echo An Array inside a EOF statement
body: <p>I'm trying to send an HTML email receipt from a shopping cart purchase but I don't get how to echo the session array within the EOF area. php doesn't seem to want to execute here. Thoughts?</p>
  
  <pre><code>//begin of HTML message
  $message = &lt;&lt;&lt;EOF
  &lt;html&gt;
  &lt;body style="font-family: 'Myriad Pro', 'DejaVu Sans Condensed', Helvetica, Arial, sans-serif;     
  font-size:10px;"&gt;&lt;center&gt;
  
  
  &lt;table width="750" cellpadding="0" cellspacing="0" class="view-cart" style="text-    
  align:center;padding:5px;"&gt;&lt;tr&gt;
  &lt;tr&gt;&lt;td&gt;Image&lt;/td&gt;&lt;td&gt;SKU&lt;/td&gt;&lt;td&gt;Description&lt;/td&gt;&lt;td&gt;QTY&lt;/td&gt;&lt;td&gt;Price&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
  
       foreach ($_SESSION["products"] as $cart_itm)
          {
              echo '&lt;td&gt;&lt;img src="'.$cart_itm['image'].'"&gt;&lt;/td&gt;';
              echo '&lt;td&gt;';
              echo '&lt;div class="p-code"&gt;'.$cart_itm["code"].'&lt;/td&gt;';
              echo '&lt;td align="left"&gt;'.$cart_itm["description"].'&lt;/td&gt;';
              echo '&lt;td&gt;'.$cart_itm["qty"].'&lt;/td&gt;';
              echo '&lt;td&gt;&lt;div class="p-price"&gt;'.$cart_itm["price"].' each&lt;/div&gt;&lt;/td&gt;';
              echo '&lt;td&gt;&lt;/td&gt;';
              echo '&lt;/tr&gt;';
          }
  
      &lt;/table&gt;
  
  
  &lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  EOF;
  //end of message
  $headers  = "From: $from\r\n";
  $headers .= "Content-type: text/html\r\n";
  
  mail($to, $subject, $message, $headers);
  </code></pre>
  
  <p>The updated code now looks like this. I replaced the "$message +=" with "$message .=" and it seems to work fine now. :</p>
  
  <pre><code> //begin of HTML message
   $message = &lt;&lt;&lt;EOF
   &lt;html&gt;
    &lt;body style="font-family: 'Myriad Pro', 'DejaVu Sans Condensed', Helvetica, Arial, sans-serif; font-size:10px;"&gt;&lt;center&gt;
  
  
   &lt;table width="750" cellpadding="0" cellspacing="0" class="view-cart" style="text-align:center;padding:5px;"&gt;
   &lt;tr&gt;&lt;td&gt;Image&lt;/td&gt;&lt;td&gt;SKU&lt;/td&gt;&lt;td&gt;Description&lt;/td&gt;&lt;td&gt;QTY&lt;/td&gt;&lt;td&gt;Price&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
  
   EOF;
  
  foreach ($_SESSION["products"] as $cart_itm) 
   {
              $message .= "&lt;td&gt;&lt;img src=".$cart_itm['image']."&gt;";
              $message .= "&lt;/td&gt;&lt;td&gt;".$cart_itm['code'];
              $message .= "&lt;/td&gt;&lt;td&gt;".$cart_itm['description'];
              $message .= "&lt;/td&gt;&lt;td&gt;".$cart_itm['qty'];
              $message .= "&lt;/td&gt;&lt;td&gt;".$cart_itm['price'] ;
              $message .= "each&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;";
          }
  
  $message2 = &lt;&lt;&lt;EOF
  
      &lt;/table&gt;
  
  &lt;hr&gt;&lt;table width="750" cellpadding="0" cellspacing="0" class="view-cart"&gt;&lt;tr&gt;
  &lt;td align="right"&gt;&lt;b&gt;Shipping: $ $shipping &lt;/b&gt;&lt;br&gt;&lt;b&gt;Total: $ $total &lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  
  
  &lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  EOF;
  </code></pre>