Firstly, thanks to Shozab Hasan and user359650 for these tests. I was wondering which choice was the best, and now I know:
To encode a simple array, JSON, which works with both PHP and javascript, possibly with other languages.
To encode a PHP object, serialization is the best choice due to the specifics of PHP objects, which may not be compatible with PHP.
To store data, either store the encoded data in a file, or use MySQL with a standard format. It would be much easier to get your data back. MySQL has great features for retrieving data as you would like to retrieve it without PHP processing.
I have never done any tests, but I believe that storing files is the best way to save your data if sorting system files is enough to return your files in alphabetical order. MySQL craves for this kind of cure and uses the file system too ...
Vidda Nov 04 '12 at 23:28 2012-11-04 23:28
source share