Read/write a text file

Discussion in 'PHP' started by enchance, Oct 25, 2007.

  1. #1
    What do I use to create and write into a text file and then read as well. I'm thinking of adding inline comments to my sites articles. Or is there a better way to do it other than read/write text files?
     
    enchance, Oct 25, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Oct 25, 2007 IP
  3. benajnim

    benajnim Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Could use a relational database:

    sqllite
    mysql
    postgres
     
    benajnim, Oct 25, 2007 IP
  4. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #4
    Also you can read much more easy with


    $data=file_get_contents('file.txt');

    or even
    $data_file_get_contents('http://www.geoseo.com'); things like that
     
    redhits, Oct 25, 2007 IP
  5. enchance

    enchance Peon

    Messages:
    109
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Oh, ok I get it. Sorry I don't know how to use a database. Me a noobie. :D
     
    enchance, Oct 26, 2007 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375