I am trying to read/write a one dimensional array into a file. Which is faster method to do this for read/replace?
- Serializing the array into the file, then loading it back again
- Using XML
- Using INI
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think, it depends on the data types and how you use it.
There is one more method you haven’t mentioned: JSON (if you don’t have to save the data types, takes less space than serialized array).
This may help: Preferred method to store PHP arrays (json_encode vs serialize)