Re: Editing Files: Help!
- From: Rik <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 03:15:46 +0200
On Tue, 31 Jul 2007 03:10:10 +0200, ttrium <arcotik@xxxxxxxxx> wrote:
Ok, so this is probably the easist question ever posted, but I
honestly can't find the answer (if there is one).
How do I (by which function) add data to a file at the beginning of a
file, rather than the end of the file (as is with fopen(file, "a"))?
You cannot 'prepend' data. You'll have to fetch the content, write your new content to the beginning of the file, and then add the old content.
--
Rik Wasmus
.
- Follow-Ups:
- Re: Editing Files: Help!
- From: ttrium
- Re: Editing Files: Help!
- References:
- Editing Files: Help!
- From: ttrium
- Editing Files: Help!
- Prev by Date: Editing Files: Help!
- Next by Date: Re: Does passing an uninitialized array variable initialize it? (PHP 5)
- Previous by thread: Editing Files: Help!
- Next by thread: Re: Editing Files: Help!
- Index(es):