Reply to Re: deleting a line

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация