Re: Can anyone help me with fopen ?
| From: | Jason Wong | Date: | Fri, 17 May 2002 07:56:09 +0000 |
| Subject: | Re: Can anyone help me with fopen ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98022@lists.php.net to get a copy of this message | ||
On Friday 17 May 2002 14:30, Roman Duriancik wrote:
> I have some text file, in this text file i write some information.
> But my problem is : How write/append new information on beginning of
> document but
> old information will be there too. When I used fopen with option "a" or
> "r+" and
> with command rewind new information rewrited old information.
Read the old file into an array, prepend the new stuff to the array, write out
the whole array overwriting the old file. Shouldn't be much of a problem if
your files are not too large (say less than 10MB).
Maybe you should look at restructuring your file so that new stuff are added
to the /end/ of the file.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Dear Lord: Please make my words sweet and tender, for tomorrow I may
have to eat them.
*/