Forum Moderators: coopster

Message Too Old, No Replies

parsing flat-files

         

scorpion

5:54 am on Jun 17, 2003 (gmt 0)

10+ Year Member



Is there a way in php to return chunks of text data without having to do a complex pattern match?

For example, I'm trying to read data from a text file of the form:

key,data1,data2
key2,data1,data2
key3,data1,data2

Is there a way to first match the right key and then to return each data element in a string?

jatar_k

6:03 am on Jun 17, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could read each line, split it on comma and pop it into an array and do what you like with it.