mmerril1 Posted January 6, 2009 Share Posted January 6, 2009 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 More sharing options...
flyhoney Posted January 6, 2009 Share Posted January 6, 2009 Try "\r\n" Link to comment https://forums.phpfreaks.com/topic/139693-writing-to-file-cannot-start-a-new-line/#findComment-730905 Share on other sites More sharing options...
mmerril1 Posted January 6, 2009 Author Share Posted January 6, 2009 its a miracle ty so much! Link to comment https://forums.phpfreaks.com/topic/139693-writing-to-file-cannot-start-a-new-line/#findComment-730907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.