Help with PHP Filesystem

Discussion in 'PHP/MySql' started by bitane, Aug 17, 2011.

  1. bitane New Member

    Member Since:
    Jun 17, 2011
    Message Count:
    269
    Likes Received:
    0
    I believe that PHP's filesystem will fit what I want to do but I am having trouble finding the appropiate items to do the following:

    -Delete a selected line from a text file (For Example: Remove line 40 of a 100 line text file. Therefore, what was line 41 is now line 40 and there are now 99 lines in total)

    -Add a line to a preexisting text file (For Example: A string is added to the end of the file [A 98 line text file becomes 99 line] or a string is inserted at a selected line of in the file[The string is made line 45 and what was previously line 45 becomes line 46])

    -Edit/replace a certain line in a preexisting text file (For Example: Line 34 which says "Hello I am sam" is changed to say "This is John")

    If any of you know a function or a method that can do either of these, do tell.

Share This Page