|
Posted by Toby A Inkster on 04/11/07 14:34
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!
[Back to original message]
|