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.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to