graham23s Posted April 20, 2010 Share Posted April 20, 2010 Hi Guys, I'm using this code to write emails to a .txt file: $myFile = "leads/emails.txt"; $fh = fopen($myFile, 'a') or die ("can't open leads file!"); $stringData = "$conEM\n"; fwrite($fh, $stringData); fclose($fh); It works great but it doesn't create a new line after every email they are all like: email1email2email3 etc i thought the \n would have done the trick. thanks for any help guys Graham Link to comment https://forums.phpfreaks.com/topic/199161-new-line-in-txt-file/ Share on other sites More sharing options...
Ken2k7 Posted April 20, 2010 Share Posted April 20, 2010 Try \r\n Link to comment https://forums.phpfreaks.com/topic/199161-new-line-in-txt-file/#findComment-1045309 Share on other sites More sharing options...
graham23s Posted April 20, 2010 Author Share Posted April 20, 2010 Thanks Ken worked perfect Graham Link to comment https://forums.phpfreaks.com/topic/199161-new-line-in-txt-file/#findComment-1045310 Share on other sites More sharing options...
ignace Posted April 20, 2010 Share Posted April 20, 2010 That \n indeed did the trick but you used the wrong editor to open it, notepad requires \r\n Link to comment https://forums.phpfreaks.com/topic/199161-new-line-in-txt-file/#findComment-1045346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.