Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2000

    [PHP] questions abt fwrite()


    I have coded a script that do some processing every 5 mins and assign some values into a string, then writes the string into a text file.

    The problem I am facing now is that, everytime it writes, it writes after the existing contents, but I would like to have it overwrites all the existing data.

    Is there any easy way to do this? Tried looking through the documentation but found nothing useful there. :/

    Thanks in advance for the help.

  2. #2
    Join Date
    Jul 2003
    Open the file in the "w" mode, which will open the file and delete anything that's in there.

    More information on available modes is at the fopen manual page.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    Join Date
    Dec 2000
    oh ... thanks!

    I was looking at fwrite, delete and all the other functions

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts