Page 1 of 1

Enquiry on data format?

Posted: Mon Mar 31, 2014 1:14 am
by george.to
Hello All,

May I ask what it is? It is not JSON nor YAML.
a:1:{i:0;a:3:{s:9:"file_name";s:61:"data/storage/attachments/aabbccdd.jpg";s:5:"width";s:3:"100";s:6:"height";s:2:"73";}}
I am looking for a PHP function to decode (structure) it. Please help.

Thank you very much for your attention

Regards
George

Re: Enquiry on data format?

Posted: Mon Mar 31, 2014 2:37 am
by requinix
That's serialized. To restore it to the array it represents, unserialize it.

For the record, serializing is not a safe way of storing data as the format may (or may not) change in future versions of PHP. JSON or even actual PHP code is better.