Jump to content

Writing to file, cannot start a new line


mmerril1

Recommended Posts

I am sure this is a small problem but i do not know what to put.

those "\n" do not work on pending.txt

all the information just gets written on one long line

I want to write on  a new line

 

Do i use something different that \n with .txt files?

 

Thank you for help!

Does this website have rep?

 

	//putting vars togeather
$final = "<p>$title $disc $address $web $email $phone $fax</p>";
//pending file add
$filename = "pending.txt";
$fp = fopen($filename, 'a') or die("Couldn't open $filename");
fwrite($fp, $final);
fwrite($fp, "space\n\n");
fclose($fp);

Link to comment
https://forums.phpfreaks.com/topic/139693-writing-to-file-cannot-start-a-new-line/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.