title: PHP Generated CSV File filled with html crap from webhost instead of data?
body: <p>I am using PHP to generate a csv file with a first name and second name.</p>
  
  <p>On my local XAMPP server it works fine and generate this output.</p>
  
  <pre><code>Andy,Murray
  Sarah,Palin
  Bob,Saget
  </code></pre>
  
  <p>However on this 000webhost.com free webhosting site I get the following output.</p>
  
  <pre><code>    &lt;br&gt;&lt;table border='1' cellpadding='2' bgcolor='#FFFFDF' bordercolor='#E8B900' align='center'&gt;&lt;tr&gt;&lt;td&gt;&lt;font face='Arial' size='1' color='#000000'&gt;&lt;b&gt;PHP Error Message&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
  &lt;b&gt;Warning&lt;/b&gt;:  array_walk() [&lt;a href='function.array-walk'&gt;function.array-walk&lt;/a&gt;]: The argument should be an array in &lt;b&gt;/home/a2806375/public_html/csv.php&lt;/b&gt; on line &lt;b&gt;15&lt;/b&gt;&lt;br /&gt;
  &lt;br&gt;&lt;table border='1' cellpadding='2' bgcolor='#FFFFDF' bordercolor='#E8B900' align='center'&gt;&lt;tr&gt;&lt;td&gt;&lt;div align='center'&gt;&lt;a href='http://www.000webhost.com/'&gt;&lt;font face='Arial' size='1' color='#000000'&gt;Free Web Hosting&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  &lt;!-- Hosting24 Analytics Code --&gt;
  &lt;script type="text/javascript" src="http://stats.hosting24.com/count.php"&gt;&lt;/script&gt;
  &lt;!-- End Of Analytics Code --&gt;
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>function outputCSV($data) 
          {
              $outstream = fopen("php://output", "w");
  
  
              function __outputCSV(&amp;$vals, $key, $filehandler) 
              {
                  fputcsv($filehandler, $vals); // add parameters if you want
              }
              array_walk($data, "__outputCSV", $outstream);
              fclose($outstream);
          }
  
  
  
          $result = $db-&gt;fetch_array($result);
  
          header("Content-type: text/csv");
          header("Content-Disposition: attachment; filename=guestlist.csv");
          header("Pragma: no-cache");
          header("Expires: 0");
  
  
          outputCSV($result);
  </code></pre>
  
  <p>Why is it doing this?</p>
  
  <p>Is it because its a free hosting site and they are trying to put advertising in a CSV file?</p>
  
  <p>How do I work around, I am a bit low on money atm so I cant afford a paid server.
  Thanks</p>