Enquiry on data format?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
george.to
Forum Newbie
Posts: 1
Joined: Mon Mar 31, 2014 1:08 am

Enquiry on data format?

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Enquiry on data format?

Post 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.
Post Reply