Re: deleting a line
- From: Toby A Inkster <usenet200703@xxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Apr 2007 15:34:49 +0100
Kim André Akerø wrote:
// 1. Join the array to a single string (newlines are already attached)
// 2. Write the updated array to the new file
fwrite($lines_update, join("", $lines);
Missing a closing parenthesis here, but otherwise, yes, something like
this. Though personally I'd check the return value from fwrite() before
you go and do this:
// Remove the old file
unlink("./member.txt");
// Rename the new file to use the old filename, replacing the old file
rename("member-new.txt","member.txt");
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
.
- References:
- deleting a line
- From: programming
- Re: deleting a line
- From: Toby A Inkster
- Re: deleting a line
- From: programming
- Re: deleting a line
- From: Kim André Akerø
- deleting a line
- Prev by Date: Re: Can anyone see a problem with this email script?
- Next by Date: List all declared variables
- Previous by thread: Re: deleting a line
- Next by thread: Re: deleting a line
- Index(es):
Relevant Pages
|