从Web服务反序列化PHP数据 [英] Deserializing PHP Data from Web service
本文介绍了从Web服务反序列化PHP数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在从网络服务接收数据。数据采用以下格式:
I'm receiving data from a web service. The data are 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";}
我需要解析输入。
您能告诉我这是什么格式以及最简单的方法吗
Can you advise me what format is this and what is the easiest way to parse them?
...
我可以通过用';'分割字符串并进行搜索来进行解析所需键的各个元素和以下值。 (可能,但是很糟糕的解决方案)
数据可能会以标准格式序列化,并且可以在字典中反序列化。
I can parse by splitting the string by ';' and to search the individual elements for the wanted key and the following value. (possible, but bad solution) Probably the data are serialized in a standard format and can be deserialized in a dictionary.
推荐答案
这是PHP自己的序列化格式。尝试 Sharp序列化库进行阅读。
This is PHP's own serialization format. Try Sharp Serialization Library to read this in.
这篇关于从Web服务反序列化PHP数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文