jfreak53
03-24-2007, 09:36 PM
Ok here's what I need to do. I need to read a file that looks like this:
g1.jpg::Description #1
g2.jpg::Description #2
I need each side of that "::" to be a different variable and I need it in some kind of while loop till the end of the file. I've tried a coupld of split and explode versions and can't get it going, basically because of that end of the line when it starts a new one. This file displays descriptions for pictures in another script, and it splits it by of course as you can see the file name then the "::". But since I'm not reading the file list I can't get that other splitter. I don't want to read the directory list because in case the file isn't there anymore I don't want that to conflict with reading the file out and displaying the contents. Basically what I want to do is have an input box for each one, and then at the end of the php file allow the user to click on save to save it back to the file if they edited anything.
g1.jpg::Description #1
g2.jpg::Description #2
I need each side of that "::" to be a different variable and I need it in some kind of while loop till the end of the file. I've tried a coupld of split and explode versions and can't get it going, basically because of that end of the line when it starts a new one. This file displays descriptions for pictures in another script, and it splits it by of course as you can see the file name then the "::". But since I'm not reading the file list I can't get that other splitter. I don't want to read the directory list because in case the file isn't there anymore I don't want that to conflict with reading the file out and displaying the contents. Basically what I want to do is have an input box for each one, and then at the end of the php file allow the user to click on save to save it back to the file if they edited anything.