chris_uK_83 Posted April 23, 2007 Share Posted April 23, 2007 Does anyone know how I can force new lines to happen in a .txt file that stores the results of a webform that a user inputs? As it stands I've tried using <br/> and /n tags but they just print to the file and all the text runs on. Also, every time data is appended to the .txt file it appears on the same line. This is irritating. Can anyone help? Link to comment https://forums.phpfreaks.com/topic/48282-formatting-of-a-txt-file-output-from-a-web-form/ Share on other sites More sharing options...
trq Posted April 23, 2007 Share Posted April 23, 2007 You cant see newlines ( \n ) in text files. When you try and display the textfile back in a browser, use nl2br to insert <br /> tags after newlines. Link to comment https://forums.phpfreaks.com/topic/48282-formatting-of-a-txt-file-output-from-a-web-form/#findComment-236032 Share on other sites More sharing options...
chris_uK_83 Posted April 23, 2007 Author Share Posted April 23, 2007 What I'm after is a way to get the program to format the text nicely in the .txt file, not the other way round. I want to be able to read the .txt file without having to interpret it with some more code. I'll try that method, but I'm not sure it's what I'm after. Link to comment https://forums.phpfreaks.com/topic/48282-formatting-of-a-txt-file-output-from-a-web-form/#findComment-236035 Share on other sites More sharing options...
trq Posted April 23, 2007 Share Posted April 23, 2007 What I'm after is a way to get the program to format the text nicely in the .txt file, not the other way round. wordwrap may help you out then. Link to comment https://forums.phpfreaks.com/topic/48282-formatting-of-a-txt-file-output-from-a-web-form/#findComment-236060 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.