$pingluninfo = <<
{
"title": "123",
"url": "Http://localhost/?p=9",
"Ttime": 1401327899094,
"SourceID": "9",
"ParentID": "0",
"CategoryID": "",
"ownerID": "",
"Metadata": "",
"Comments": [
{
"Cmtid": "358",
"CTime": 1401327899094,
"Content": "August 1, 2013 18:36:29 O (∩_∩) o~",
"Replyid": "0",
"User": {
"userid": "1",
"Nickname": "Admin",
"Usericon": "",
"Userurl": "",
"Usermetadata": {
"Area": "Beijing",
"Gender": "1",
"KK": "",
"Level": 1
}
},
"IP": "127.0.0.1",
"UserAgent": "mozilla/5.0 (Windows NT 6.1; rv:22.0) gecko/20100101 firefox/22.0 ",
"Channeltype": "1",
"From": "",
"Spcount": "",
"Opcount": "",
"Attachment": [
{
"Type": 1,
"desc": "",
"url": "Http://img.sohu.itc/xxxx"
}
]
}
]
}
EOT;
$pingluninfo = Json_decode ($pingluninfo, true);
if (! $pingluninfo) {
Die (' Wrong data format ');
}
?>
Always output the wrong data format
Reply to discussion (solution)
Look at the JSON is wrong.
Chinese is not like this after the Json_encode.
";p Rint_r ($pingluninfo); echo"
";
Output:
Array ([title] = 123 [url] = http://localhost/?p=9 [Ttime] = 1401327899094 [SourceID] + 9 [ ParentID] + 0 [CategoryID] = [ownerID] + [metadata] = [comments] = = Array ( [0] = = Array ([Cmtid] = 358 [CTime] = 1401327899094 [Content] = August 1, 2013 18:36:29 O (∩_∩) o~ [Replyid] = 0 [US ER] = Array ([userid] = 1 [nickname] = = admin [Usericon] [userurl] = = [Usermetadata]/= Array ([area] = Beijing [Gender] = 1 [KK] = [Level] = 1 )) [IP] = 127.0.0.1 [use Ragent] = mozilla/5.0 (Windows NT 6.1; rv:22.0) gecko/20100101 firefox/22.0 [Channeltype] = 1 [From] = [Spcount] [opcount] = = [Attachment] = = Array ([0] = = Array ([Type] = 1 [desc] = = [url] = http://img.sohu.itc/xxxx)) ) ))
Test error
Please enclose the quotation marks!
"Ttime": 1401327899094, should be "ttime": "1401327899094",
Other similar
Echo '
'; $pingluninfo = <<
Tested, very normal.
([title] = 123 [url] = http://localhost/?p=9 [Ttime] = 1401327899094 [SourceID] + 9 [paren TID] = 0 [CategoryID] = [ownerID] = [metadata] = [comments] + = Array ( [0] = = Array ([Cmtid] = 358 [CTime] = 1401327899094 [Content] = August 1, 2013 18:36:29 O (∩_∩) o~ [Replyid] = 0 [user] = > Array ([userid] = 1 [nickname] => ; admin [Usericon] = [Userurl] = [Usermetadata]/= Array ([area] = Beijing [Gender] = 1 [KK] = [Level] = 1 )) [IP] = 127.0.0.1 [Useragen T] = mozilla/5.0 (Windows NT 6.1; rv:22.0) gecko/20100101 firefox/22.0 [Channeltype] = 1 [from] [spcount] = [Opcount] = [att Achment] = Array ([0] = = Array ( [Type] = 1 [desc] = [url] = http://img.sohu.itc/xxxx)) ) ))
You are the new version of it! Estimated numeric value exceeded max.
You are the new version of it! Estimated numeric value exceeded max.
The new version? What do you say?
I copied the code above saying that the test was normal to me, which is a hint of a data error.
Looks like a real environmental problem.
I copied the code above saying that the test was normal to me, which is a hint of a data error.
Looks like a real environmental problem.
Echo '
'; $pingluninfo = <<
Tested, very normal.
([title] = 123 [url] = http://localhost/?p=9 [Ttime] = 1401327899094 [SourceID] + 9 [paren TID] = 0 [CategoryID] = [ownerID] = [metadata] = [comments] + = Array ( [0] = = Array ([Cmtid] = 358 [CTime] = 1401327899094 [Content] = August 1, 2013 18:36:29 O (∩_∩) o~ [Replyid] = 0 [user] = > Array ([userid] = 1 [nickname] => ; admin [Usericon] = [Userurl] = [Usermetadata]/= Array ([area] = Beijing [Gender] = 1 [KK] = [Level] = 1 )) [IP] = 127.0.0.1 [Useragen T] = mozilla/5.0 (Windows NT 6.1; rv:22.0) gecko/20100101 firefox/22.0 [Channeltype] = 1 [from] [spcount] = [Opcount] = [att Achment] = Array ([0] = = Array ( [Type] = 1 [desc] = [url] = http://img.sohu.itc/xxxx)) ) ))
I copied the code above saying that the test was normal to me, which is a hint of a data error.
Looks like a real environmental problem.
";p Rint_r ($pingluninfo); echo"
";
Output:
Array ([title] = 123 [url] = http://localhost/?p=9 [Ttime] = 1401327899094 [SourceID] + 9 [ ParentID] + 0 [CategoryID] = [ownerID] + [metadata] = [comments] = = Array ( [0] = = Array ([Cmtid] = 358 [CTime] = 1401327899094 [Content] = August 1, 2013 18:36:29 O (∩_∩) o~ [Replyid] = 0 [US ER] = Array ([userid] = 1 [nickname] = = admin [Usericon] [userurl] = = [Usermetadata]/= Array ([area] = Beijing [Gender] = 1 [KK] = [Level] = 1 )) [IP] = 127.0.0.1 [use Ragent] = mozilla/5.0 (Windows NT 6.1; rv:22.0) gecko/20100101 firefox/22.0 [Channeltype] = 1 [From] = [Spcount] [opcount] = = [Attachment] = = Array ([0] = = Array ([Type] = 1 [desc] = = [url] = http://img.sohu.itc/xxxx)) ) ))
Test error