You are really at the point where you need to use a database. BUT if you're going to store this information in text or a database, I suggest you attempt to get it into some type of tabular form - study up on databases and their organization some.
Your data should be "grouped" and then "sub-grouped", and etc. - with a CSV file, fields are separated by commas and lines are separated by a return chracter. Commas in double quotes are ignored, AND PHP has a function fgetcsv() which is rock-solid reliable.
So if you're going the text file route, do some searching on CSV formatting rules and know them well.
To split your data, use $array = explode('|', $string); which groups by pipe, then you could loop throught that and break down by '*' - but again, better to stick with standard formatting.
However, you really should consider a datbase from what I'm seeing of your programming.
Samuel
eyeofthestorm wrote:i've just finished customizing a photo gallery in php to make it fully dynamic...and its all working with all the information in a text file and then i use that information to create the gallery...and now that its done, i want to make an easier way to write to the text file rather than opening up and changing it as needed. So i want to create some sort of form where i can input all the information and even upload a new image and it will write to the text file in the following form:
Awesome Gallery|photos/|142391447_l.jpg-thumbs/142391447_l.jpg-so flamboyant-Mr. moves142391784_l.jpg-thumbs/142391784_l.jpg-wild and crazy is he-Rockin' danny142392907_l.jpg-thumbs/142392907_l.jpg-not anymore-Cut Shallow on tour142394266_l.jpg-thumbs/142394266_l.jpg-the only one wes is in and you can still barely see him-the whole gang51716042_l.jpg-thumbs/51716042_l.jpg-hawaiians are so hawaiian-hawaii51801565_l.jpg-thumbs/51801565_l.jpg-what the...-wide–eyed wescsmyspace.jpg-thumbs/csmyspace.jpg-don't we just rock your face off?-Cut Shallow*cssicck500.jpg-thumbs/cssicck500.jpg-you heard me, shoot.-Epitome of awesome
i have each set of gallery information divided by "|" and then i have more information for the images where each set of image information is divided by "*" and going further, each peice of information is "-". So i was wondering how i would create a form that could write all the information to the text file sorted in the proper way i need in order to read it.
can anyone help me? thanks in advance for any help i might get. =)