file handling problem plz help me...............

Discussion in 'PHP' started by dineshsingh1984, Apr 4, 2011.

  1. #1
    How to append a specific line in any doc file through the file handling
    I want to append the specific line/word in the doc file
    for example ..............
    if in doc file include a 3 lines and i want to change 2nd line

    "my name is price.
    I'm working in ncr zone.
    I'm working in a software company."


    here i want to change second line "I'm working in ncr zone."

    how can do it?????????????????????
    plz help...............
    it's urgent...............
     
    dineshsingh1984, Apr 4, 2011 IP
  2. CI-Andrew

    CI-Andrew Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    In a text file you can read the contents using file_get_contents() then you could explode() the contents with a line break as the delimiter to work out which is the 2nd line. Modify and then output to the same file. That should be enough to get you started!
     
    CI-Andrew, Apr 5, 2011 IP