Trouble creating a tab delimited file with PHP
<p>I'm trying to create a tab delimited file with PHP and having some troubles. Basically my tabs, and line breaks ie \t and \n end up being printed out instead of converted to what they are supposed to be.</p>

<p>My code is simple:</p>

<pre><code>$sql = 'SELECT * FROM products ';
$res = mysql_query($sql);


$page_print = 'id \t title \t description \t price ';

while($row = mysql_fetch_array($res)) {

$page_print .= $row['product_id'] . ' \t ' . $row['product_name'] . ' \t ' . strip_tags($row['product_content']) . ' \t ' . $row['product_price'] . '\n;

}


$page_print = sanitize_output($page_print);

$myFile = "products.txt";
$fh = fopen($myFile, 'w');
$stringData = trim($page_print);
fwrite($fh, $stringData);
fclose($fh);
</code></pre>

<p>What am I doing wrong here?</p>
