PHP Header Problem
<p>My code is no white spaces before or afther </p>

<pre><code>&lt;?php
ob_start();
header("content-type:text/xml; charset=UTF-8");

function getXML($sql="Default Query")
{
    $conn=mysql_connect("*","*","*");
    $db=mysql_select_db("*");
    $result = mysql_query($sql,$conn);
    $columns="";
    echo "&lt;records&gt;";
    while($row=mysql_fetch_assoc($result))
    {
        $columns.="&lt;record&gt;";
        foreach($row as $key =&gt; $value)
        {
            $reptxt = str_replace("&amp;", "&amp;amp;", $value);
            $columns.="&lt;$key&gt;$reptxt&lt;/$key&gt;";
        }
        $columns.="&lt;/record&gt;";
    }
    echo $columns;
    echo "&lt;/records&gt;";
}
getXML("SELECT 0,1,4,5 FROM KK_VOISTLEJAD");
ob_end_flush();
?&gt;
</code></pre>

<p>And error what i get is: Warning: Cannot modify header information - headers already sent by (output started at .../htdocs/data.php:1) in .../htdocs/data.php on line 2</p>

<p>Whats wrong?</p>
