Update!
I have stopped it from always showing the JSON raw data by changing:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
to:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
and I have changed:
$json = json_decode(curl_exec($ch), true);
to:
$json = json_decode(curl_exec($ch));
It is quite long but for clarity I have posted the beatufied JSON data below - In this example, there are 2 character IDs (There can be anything up to 3) - I am trying to figure out what code is needed to display a list of both of these character IDs. I’ve removed as much of the unnecessary code that makes up the majority of the JSOn request and highligthed the two objects/parameters I am trying to fetch.
{
"Response": {
"data": {
"membershipId": "4611686018448666364",
"membershipType": 2,
"characters": [
{
"characterBase": {
"membershipId": "4611686018448666364",
"membershipType": 2,
**"characterId": "2305843009292449175",**
"dateLastPlayed": "2015-10-30T06:28:09Z",
"minutesPlayedThisSession": "233",
"minutesPlayedTotal": "25725",
"powerLevel": 304,
"raceHash": 2803282938,
"genderHash": 3111576190,
"classHash": 2271682572,
"currentActivityHash": 0,
"lastCompletedStoryHash": 0,
"customization": {
"personality": 2166136261,
"face": 820889531,
"skinColor": 2542514572,
"lipColor": 1328348389,
"eyeColor": 1511637744,
"hairColor": 204829631,
"featureColor": 2166136261,
"decalColor": 2304614797,
"wearHelmet": false,
"hairIndex": 8,
"featureIndex": 0,
"decalIndex": 3
},
"grimoireScore": 4030,
"peerView": {
"equipment": [
{
"itemHash": 3828867689,
"dyes": []
}
"genderType": 0,
"classType": 2,
"buildStatGroupHash": 2172613790
},
"levelProgression": {
"dailyProgress": 0,
"weeklyProgress": 0,
"currentProgress": 346000,
"level": 40,
"step": 0,
"progressToNextLevel": 0,
"nextLevelAt": 0,
"progressionHash": 1716568313
},
"emblemPath": "/common/destiny_content/icons/4de8116ee7acef7c2419924b12f9636f.jpg",
"backgroundPath": "/common/destiny_content/icons/06587476c45a2de2b7b09d5e6690575e.jpg",
"emblemHash": 2372257458,
"characterLevel": 40,
"baseCharacterLevel": 40,
"isPrestigeLevel": false,
"percentToNextLevel": 0
}
{
"characterBase": {
"membershipId": "4611686018448666364",
"membershipType": 2,
**"characterId": "2305843009316656187",**
"dateLastPlayed": "2015-10-04T11:37:34Z",
"minutesPlayedThisSession": "2",
"minutesPlayedTotal": "2005",
"powerLevel": 135,
"raceHash": 3887404748,
"genderHash": 3111576190,
"classHash": 3655393761,
"currentActivityHash": 0,
"lastCompletedStoryHash": 0,
"customization": {
"personality": 2166136261,
"face": 2680554480,
"skinColor": 683440567,
"lipColor": 3571537821,
"eyeColor": 1194006499,
"hairColor": 280639505,
"featureColor": 2166136261,
"decalColor": 1213241010,
"wearHelmet": false,
"hairIndex": 9,
"featureIndex": 0,
"decalIndex": 0
},
"grimoireScore": 4030,
"peerView": {
"equipment": [
{
"itemHash": 2455559914,
"dyes": []
},
},
"genderType": 0,
"classType": 0,
"buildStatGroupHash": 1235322459
},
"levelProgression": {
"dailyProgress": 0,
"weeklyProgress": 0,
"currentProgress": 274000,
"level": 34,
"step": 0,
"progressToNextLevel": 0,
"nextLevelAt": 9000,
"progressionHash": 1716568313
},
"emblemPath": "/common/destiny_content/icons/54f048e157d97193ccf618b8b5fa8102.jpg",
"backgroundPath": "/common/destiny_content/icons/f63cfeb14c128400a793b63c857156bc.jpg",
"emblemHash": 1600609907,
"characterLevel": 34,
"baseCharacterLevel": 34,
"isPrestigeLevel": false,
"percentToNextLevel": 0
}
],
"clanName": "Little Big Light",
"clanTag": "LBL",
"inventory": {
"items": []
},
"grimoireScore": 4030,
"versions": 15
}
},
"ErrorCode": 1,
"ThrottleSeconds": 0,
"ErrorStatus": "Success",
"Message": "Ok",
"MessageData": {}
}