Flat File Help

Discussion in 'PHP' started by VoYdE, Apr 15, 2008.

  1. #1
    How would I go about storing the recent entrys in a flat file?

    EX.
    You submit your name
    Your name is added into a flat file (at the top)
    and the name at the bottom is erased.

    Limit ten.


    How?
     
    VoYdE, Apr 15, 2008 IP
  2. JLEville

    JLEville Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use PHP's fopen, fwrite, fclose. If you need more help, pm me.
     
    JLEville, Apr 15, 2008 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    Open/read the file.

    Split the content into an array using newline separator.

    Create a new array, with the new item and add 9 of the 10 items in the first array.

    Write the new content.

    Peace,
     
    Barti1987, Apr 15, 2008 IP