I am trying to get value of c_user, xs, fr
and date
value through JSON from below code and save it to database but it is not working here is my code which I used.
$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;
Here is the Json code
{
"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"
}
NOTE: I have success in getting $token2
and $id
. How to get the values of xs, fr, date, c_user
?