title: Exporting an array to Excel
body: <p>I'm trying to export an array of arrays to excel.  I have it set up to be a header variable, and a data variable that basically builds a giant string to be executed in the export.  However, only the header variable is going through.  Let me show some code:</p>
  
  <p>This is setting the parameters:</p>
  
  <pre class="lang-php prettyprint-override"><code>    str_replace(" ", "_", $getData['name']);
      $filename = $getData['name']."_summary.xls";
      header("Content-Type: application/x-msdownload");
      header("Content-Disposition: attachment; filename=\"$filename\"");
      header("Pragma: no-cache");
      header("Expires: 0");
  </code></pre>
  
  <p>Which goes to a function to get the information:</p>
  
  <pre class="lang-php prettyprint-override"><code>foreach($tempRS as $key=&gt;$value)
  {
      foreach($value as $iKey=&gt;$iValue)
      {
          if($count == 6)
          {
              $iValue = str_replace('"', '""', $iValue);
              $iValue = '"'.$iValue.'"'."\n";
              $data .= trim($iValue);
              $count = 0;
          }
          else
          {
              $iValue = str_replace('"', '""', $iValue);
              $iValue = '"'.$iValue.'"'."\t";
              $data .= trim($iValue);
              $count++;
          }
      }
  
  }
  $header = "ROW HEADER 1\tROW HEADER 2\tROW HEADER 3\tROW HEADER 4\tROW HEADER 5\tROW HEADER 6\n";
  print "$header\n$data";
  </code></pre>
  
  <p>I can't seem to figure out why i'm losing the $data variable on the export.</p>