JSON奇怪的格式

时间:2014-09-09 17:01:39

标签: php json cakephp

我试图从几年前开始对一些蛋糕php代码进行逆向工程。数据以看起来像JSON的格式存储,但我无法确定这是自定义格式还是JSON的特定方法。

数据以这种方式存储在一个字段中(我用字母t或数字1替换了一些识别数据):

   a:7:{s:4:"site";a:11:s:13:"ttttttNumber";s:2:"13";s:14:"tttttttNumber";s:9:"001111111";s:11:"ttttSiteRef";s:16:"tt00170326300013";s:10:"tttttttttt";s:15:"D00170326300013";s:11:"ttttttName";s:28:"tttttt t tttt tt t t t ";s:19:"ttttttAddressLine1";s:17:"ttt t t t t tt t t ";s:19:"tttttAddressLine2";s:0:"";s:19:"ttttAddressLine3";s:6:"tttttt";s:19:"tttttAddressLine4";s:2:"CA";s:15:"ttttttPostcode";s:10:"11111-9424";s:7:"Address";s:29:"tttttt tttt,tt tttt";}s:15:"tttt_reference";i:8296;s:6:"detail";a:11:{s:10:"ttttt_type";s:3:"SVM";s:12:"end_datetime";s:19:"09/06/2014 10:40 PM";s:8:"site_ref";s:15:"001703263/00013";s:4:"note";s:29:"tttttttttttt t t t tt t t ";s:12:"contact_name";s:0:"";s:13:"tttttt_visit";s:2:"-1";s:10:"ttttttttt";s:12:"486900096869";...

我可以告诉s:#是字符串中的字符数,i:似乎是指整数。我想知道是否有一种简单的方法将其解码为数组,类似于json_decode。

1 个答案:

答案 0 :(得分:0)

你可以使用json_decode($ jsonString,true);这会将该数据转换为数组