Writing and reading user settings from files

Ask about a PHP problem here.
Post Reply
gourlaykid
Posts: 1
Joined: Tue Dec 06, 2011 6:39 pm

Writing and reading user settings from files

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Writing and reading user settings from files

Post 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().
Image
Post Reply