leeharvey09 Posted February 12, 2010 Share Posted February 12, 2010 i have a small script that writes input to a text file, i want each new record to be added to a newline, so its easy to read, like this, tom hanks popboy@yahoo.com I have seen news stories about implants which will help the jim jones lharvey09@mail.com Jaycee Dugard kept a journal during 18 years of captivity tim dog peterpan@mail.com Former President Bill Clinton had two stents placed in one mark brown markbrown@yahoo.com Thursday. Chief cardiologist Allan Schwartz with New York but my script produces this in the text file. $name = $_POST['sendNamehiddenField']; $email = strtolower($_POST['sendEmailhiddenField']); $message = $_POST['sendMessagehiddenField']; $feedBackRecords = array($name,$email,$message); $spaceImplode = implode(" ",$feedBackRecords); $file = "feedBackData.txt"; file_put_contents($file,$spaceImplode,FILE_APPEND); tom hanks popboy@yahoo.com I have seen news stories about implants which will help the blind see.jim jones lharvey09@mail.com Jaycee Dugard kept a journal during 18 years of captivitytim dog peterpan@mail.com Former President Bill Clinton had two stents placed in one of his coronary arteries onmark brown markbrown@yahoo.com Thursday. Chief cardiologist Allan Schwartz with New York Presbyterian Hospital says any help will be great thanks cheers Lee Harvey[/size][/size] Quote Link to comment Share on other sites More sharing options...
MRushton Posted February 12, 2010 Share Posted February 12, 2010 Use this: $spaceImplode = implode(" ",$feedBackRecords) . "\n"; Quote Link to comment Share on other sites More sharing options...
xjake88x Posted February 12, 2010 Share Posted February 12, 2010 You can also use "\r\n" which is called a CrLf or carriage return line feed. (It's just for cross-os compatibility) http://en.wikipedia.org/wiki/Crlf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.