PHP序列化/反序列化类似Objective-C中的方法 [英] PHP serialize/unserialize like method in Objective-C
问题描述
我使用序列化方法在 PHP 中序列化了一个字符串
I have serialized a string in PHP using serialize method
$serializedResult = serialize($value);
如何在 Objective-C 中反序列化这个序列化的字符串
How to unserialize this serialized string in Objective-C
推荐答案
我认为没有针对 Objective C 的序列化 PHP 对象解析器.
I don't think there is a serialized PHP object parser for Objective C.
但是您可以改用 JSON.在 PHP 端使用 json_encode
,在 Objective C 端见:http://blog.zachwaugh.com/post/309924609/how-to-use-json-in-cocoaobjective-c
However you could use JSON instead. On the PHP side use json_encode
, and on the Objective C side see: http://blog.zachwaugh.com/post/309924609/how-to-use-json-in-cocoaobjective-c
或者正如 Tommy 指出的现在的原生实现:http://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html
Or as Tommy pointed out the now native implementation: http://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html
这篇关于PHP序列化/反序列化类似Objective-C中的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!