I've got an array string serialised via PHP (Wordpress) similar to the following:
a:2:{i:0;s:12:"Sample array";i:1;a:2:{i:0;s:5:"Apple";i:1;s:6:"Orange";}}
How would I deserialise this string in C#?
If I paste the string into https://www.unserialize.com, it converts the structure fine.
Thanks!
unserializeand thenjson_encode. You can then decode that in C#.serialize()function should never have been exposed to the user space. You should never rely on it if you have a chance, and you should not, under any circumstances, unserialize user-submitted values. If you really want to do this bad thing, then the format is generally{type}:{size}:{value}with;as a delimiter. Array entries are key-value pairs. Unprintable/special characters are not escaped or treated specially, and are even part of the format. Pray you never encounter a serialized object. GLWT.