Re: Writing new lines in txt- files?

From: Date: Wed, 23 Jan 2002 17:55:28 +0000
Subject: Re: Writing new lines in txt- files?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81728@lists.php.net to get a copy of this message
> 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;

« previous php.general (#81728) next »