Page 1 of 1

Writing and reading user settings from files

Posted: Tue Dec 06, 2011 6:44 pm
by gourlaykid
hi i was hoping someone could help me here. I am trying to write user defined data (ie db settings) to a file then get them out in another file i was wondering how you would do this and if possible could someone put up an example

Re: Writing and reading user settings from files

Posted: Tue Dec 06, 2011 8:00 pm
by jacek
You can write a string to a file using file_put_contents() and read from the file using file_get_contents(). For easily storing an array and being able to get it back again when the file is read have a look at serialize() and unserialize().