SELECT from a text file where field are separated by "|" and rows separated by ";"

Discussion in 'PHP' started by Kyriakos, Oct 6, 2009.

  1. #1
    hi,

    is there a way to SELECT from a text file where fields are separated by "|" and rows separated by ";"?
    note: the text file "visitors.txt" is in the remote server in the same folder with my PHP pages.
     
    Kyriakos, Oct 6, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Assuming the ; is followed by a newline you could just use http://php.net/fgetscsv (use | as the third argument to the function). Then simply trim the ; away
     
    premiumscripts, Oct 6, 2009 IP