Sample script for writing to a file:

if ($fp = fopen("/path/to/file", "w")) {
    fwrite($fp, $text . "\n", strlen($text));
}
else { ... code to report error opening file }

You can use a loop for writing, obviously, if you have to write more than
one line (as it sounds like you do).  Just create a while() loop that gets a
line or a certain length of text from a source and write it until you reach
the end of the source.  Just remember to add the "\n" and you'll get each
line read from the source written to its own line on the destination file.

Mike Frazer



"Mëòv î?çîÎ òsyïn" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hello folks!
>
> 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? =)
>
> Thanks! //M.
>
>
>
>
> ----------------------------------------------
> Mårten Andersson
> Loddbygatan 2
> 60218 Norrköping
>
> URL: http://www.vanvett.net/marten
> email: [EMAIL PROTECTED]
> ICQ: 86515830
>
>
> _________________________________________________________________
> Kom med i världens största e-posttjänst; MSN Hotmail.
> http://www.hotmail.com/sv
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to