Forum Moderators: coopster

Message Too Old, No Replies

How do I get data from a flat file like a db

I don't have access to db

         

ogletree

10:06 pm on May 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have about 400 widgets with a price and I have it in an XML file now. I figured out how to get it from the XML file I just have to read the xml until I find what I want every time the page opens. Is there an easier way to get data from a flat file without reading going through it link by line. I don't have to keep it xml I can convert it to something else. Is there a way to index and XML file or any txt file and just say go to line 40 and get data. The order of the widgets is not important and the only thing that will change is the price. Also is just reading the file with 400 items in it not that much of a drain and I should not worry about it. I only need a db for this one thing. I don't want to have to pay extra for this.

corz

3:56 am on May 31, 2004 (gmt 0)

10+ Year Member




$file_contents = implode('', file($somefile));

that gets the whole file into a string, do whatever you like with it after that.

;o)
(or