Re: [PHP] Flush file contents
- Date: Thu, 15 May 2008 11:39:14 -0400
- From: "Andrew Ballard" <aballard@xxxxxxxxx>
- Subject: Re: [PHP] Flush file contents
On Thu, May 15, 2008 at 11:20 AM, Mário Gamito <gamito@xxxxxxxxx> wrote:
> Hi,
>
> How do I open a file and flush all it's contents to insert new ones and
> close again ?
>
> I've browsed through the fopen function aguments and didn't find one that do
> this (or I misunderstood one of them).
>
> Any help would be appreciated.
>
> Warm Regards,
> Mário Gamito
>
That's what the mode parameter is for. You want "w".
http://www.php.net/manual/en/function.fopen.php
Andrew