(again)Writing new lines in txt- files?=)

From: Date: Wed, 23 Jan 2002 19:27:04 +0000
Subject: (again)Writing new lines in txt- files?=)
Groups: php.general 
Request: Send a blank email to php-general+get-81744@lists.php.net to get a copy of this message
hello again! =) I.m using fwrite() to write to the file. What I want is a new row i a textdocument after each strung I insert.. I've been told that "\n" should be the solution to the problem whith new rows i a text-document. But I am not sure that's want I wanted... =) I'll try to be more specific.. I want to write a new row in a text document, the meaning whith that is that I want to create a logfile. And It would be mutch easier to read it if each row is a new hit to the site. When I inserted "\n" in the end of the string, it didn't created a new row in the text file. It only created a new row when I printed out the file. But I want a new row IN the textfile.. =) =) I hope I didn't complicate this matter too mutch whith my bad english.. =) Thank's folk's //M.
From: "Jeff Sheltren" <sheltren@home.com> To: Mårten Andersson <vanvettig@hotmail.com>, <php-general@lists.php.net> Subject: Re: [PHP] Writing new lines in txt- files? Date: Wed, 23 Jan 2002 09:55:28 -0800 I want to write to a textfile, but I want a row for each string I write to the file. As it is now when I write to the file it just starts writing where the last string ends.. What should I do? =) How are you writing to the file currently? Could you send some code? One way that would work if you are on *NIX would be as follows: $foo = "foobar.txt"; System("echo blahblahblah >> $foo"); If you are doing it some other way, why not just echo a newline before each string you send? $s = "string you want in file"; $s2 = "\n" . $s; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
---------------------------------------------- Mårten Andersson Loddbygatan 2 60218 Norrköping URL: http://www.vanvett.net/marten email: sillstryparen@vanvett.net ICQ: 86515830 _________________________________________________________________ Hämta MSN Explorer kostnadsfritt på http://explorer.msn.se/intl.asp.

« previous php.general (#81744) next »