How to line break when writing to php flat file?

Rash

New member
Apparently the "\n" parameter is supposed to create a line break, but I still get the output "HelloWorld" in my text file when using the code below. I am trying to get the words "Hello" and "World" on two different lines. Anyone have any idea why this is happening? Thanks


<?php
$File = "test.txt";
$Handle = fopen($File, 'w');
$Data = "Hello\n";
fwrite($Handle, $Data);
$Data = "World\n";
fwrite($Handle, $Data);
print "Data Written";
fclose($Handle);
?>
 
Back
Top