Page 1 of 1

Parsing flat text file(Special functions?)

Posted: Fri Feb 03, 2006 2:03 pm
by AlexiaES
I'm working on a script that will read data from a flat text file that is generated by Gallery 1.5. The data is arranged much like an array. Simplified example: Album{AlbumItem{Image{Properties}Properties}Properties}
Actual file: http://www.nonamestudios.com/albums/baw/photos.dat
Cut and broken into multiple lines for understanding: http://www.nonamestudios.com/albums/baw ... .dat.split

Is there some PHP functions that would make life simple in parsing that information? I really don't to start building some super complex parsing algorithm and find out one or two functions could have done it.

(Personally I would to just find where in the Gallery script it is doing this, but that has proven to be impossible.)

Posted: Fri Feb 03, 2006 2:27 pm
by josh
Just search all the files for the filename of the the file it is writing too. It will be much easier to make it output something like xml that already has functions written for PHP and solid escaping mechanisms, etc..

Posted: Sat Feb 04, 2006 12:30 am
by AlexiaES
While it would be great to change it around, I don't have that option. The script has to parse what Gallery gives me.
Anyway, I knew there had to be something, the data if the file was generated by the PHP serialize function, which can be unserialized then. I just have to get it to do it correctly!