아래 코드에서 JSON을 통해 c_user, xs, fr
및 date
값의 값을 가져 와서 데이터베이스에 저장하려고했지만 사용중인 코드는 여기에서 작동하지 않습니다.json_decode가 작동하지 않는 이유는 무엇입니까?
$data = $_GET["user"];
$data = json_decode($data);
$datr = $data->datr;
$xs = $data->xs;
$fr = $data->fr;
$c_user = $data->c_user;
$token2 = $data->access_token;
$id = $data->uid;
다음은 JSON 코드를
{
"session_key" : "5.rWdMmED7nybZ1w.1513220229.45-100007001746590",
"uid" : 100007001746590,
"secret" : "b3f2dac4a948407864ff2e4e2d8feebf",
"access_token" : "EAAAAAYsX7TsBAGSNv9YET43NxPk7PZBt1gTP0ipqQpb7ojzgn9pFf8hOLTg6V1R8IAv0y5TYgMhDlbCA0eHUN5aPOYw1DgA4c7vTgscbzY0tZALxpBk1tvIXPAisZBBZBzkyimkBurkU3iz0KmXoLQU1KY7tjxrgl7Wvxf5GwZBQbDFX4m5kMsYYDZB9UwIyl6YJA12Ac2ZBmcQBKAfOotc",
"machine_id" : "hegxWhFD-5BKWnhTe3exWvAG",
"session_cookies" : [
{
"name" : "c_user",
"value" : "100007001746590",
"expires" : "Fri,
14 Dec 2018 02 : 57 : 09 GMT",
"expires_timestamp" : 1544756229,
"domain" : ".facebook.com",
"path" : "\/",
"secure" : true
},
{
"name" : "xs",
"value" : "45 : rWdMmED7nybZ1w : 2 : 1513220229 : 13473 : 4832",
"expires" : "Fri,
14 Dec 2018 02 : 57 : 09 GMT",
"expires_timestamp" : 1544756229,
"domain" : ".facebook.com",
"path" : "\/",
"secure" : true,
"httponly" : true
},
{
"name" : "fr",
"value" : "0DfY4nJ3NUUeFKIUG.AWX4RKAQ0wBcl677F8jXJcCZ7Dc.BZj9JZ.fD.Fox.0.0.BaMeiF.AWXzlwrU",
"expires" : "Fri,
14 Dec 2018 02 : 57 : 09 GMT",
"expires_timestamp" : 1544756229,
"domain" : ".facebook.com",
"path" : "\/",
"secure" : true,
"httponly" : true
},
{
"name" : "datr",
"value" : "hegxWhFD-5BKWnhTe3exWvAG",
"expires" : "Sat,
14 Dec 2019 02 : 57 : 09 GMT",
"expires_timestamp" : 1576292229,
"domain" : ".facebook.com",
"path" : "\/",
"secure" : true,
"httponly" : true
}
],
"confirmed" : true,
"identifier" : "7250492401"
}
주이다 : 나는 $token2
및 $id
을 얻기에 성공 있습니다. xs, fr, date, c_user
의 값을 가져 오는 방법은 무엇입니까?
게시 한 JSON 데이터에 해당 값이 표시되지 않습니다 ... – Mikkel
json 데이터에 'c_user'와 같은 키가 없습니다. –
해당 데이터를 가져 오는 것보다 –