Removing PHP data deserialization from a web service

I get data from a web service. The data is in the following format:

a:5:{s:7:"request";s:14:"94.190.179.118";s:6:"status";i:206;s:12:"currencyCode";s:3:"BGL";}

I need to parse input.

Can you tell me which format it is and what is the easiest way to analyze it?

...

I can parse by dividing the string by ';' and to search for individual items for the desired key and next value. (maybe, but a bad decision) It is likely that the data is serialized in a standard format and can be deserialized in a dictionary.

+4
source share
2 answers

This is a proprietary PHP serialization format. Try the Sharp Serialization Library to read this.

+3

PHP: http://php.net/serialize

PHP . #, , 3- , .

, , API , JSON XML. #.

+5

Source: https://habr.com/ru/post/1535016/


All Articles