Good all the time of day!
Tell me, how can I access the array even one level deeper?
There is $data['Stats'] , it has 1 more array with the same name Stats :
{ "platformId": 4, "AccountId": "account.0993d6055496416f9e5710016a061b8d", "Avatar": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/37/374526a1a62802567734c74760c2d890e89c6a3b.jpg", "selectedRegion": "agg", "defaultSeason": "2017-pre4", "seasonDisplay": "Early Access Season #4", "LastUpdated": "2017-09-30T00:47:34.7304316Z", "PlayerName": "Lidman", "PubgTrackerId": 392412, "Stats": [ { "Region": "eu", "Season": "2017-pre2", "Match": "solo", "Stats": [ { "label": "K/D Ratio", "field": "KillDeathRatio", "category": "Performance", "ValueInt": null, "ValueDec": 1.33, "value": "1.33", "rank": null, "percentile": null, "displayValue": "1.33" }, Here is the code itself:
<?php $curl = curl_init(); $a = $_POST['pubg-nickname']; curl_setopt_array($curl, array( CURLOPT_URL => "https://123.com/api/profile/pc/{$a}", CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array( "cache-control: no-cache", "trn-api-key: 1111" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); $data = json_decode($response, true); $foto = $data['Avatar']; echo '<center><table class="table table-striped table-bordered table-responsive">'; foreach ($data['Stats'] as $key => $value) { echo "<tr class=".warning."> <td>".$value['Region']."</td> <td>".$value['Season']."</td> <td>".$value['Kills']."</td> <td>".$value['Match']."</td> </tr>"; } echo "</center></table>"; ?>