Hi everybody,
Recently I encounter a problem which all the data in the buffer always appear in one single line when I try to write to a XML file. I don't know why the \n newline special character doesn't work. However I found that if I change the file format to .php, the problem will be solved. Any idea? Many thanks in advanced.
<?php
//$filename = "test.php";
$filename = "test.xml";
$fp = fopen($filename, "w");
$buffer = "<?xml version=\"1.0\"?>\n<big>\n<small></small>\n</big>";
fwrite($fp, "$buffer");
?>