Good day all. I’m grabbing json info from a website and trying learn to list it but I’m running in to an issue outputting it. Every index in the json has a name and I’m wondering how I can spit them out one at a time without knowing each item’s name.
If it were a regular array I’d just do $json[0][1][3] or whatever but when I try to do it by number it gives me an Undefined offset error.
Here’s the code I’m using.
[php]<?php
$url = 'https://api.opskins.com/IPricing/GetAllLowestListPrices/v1/?appid=440';
$jsonData = file_get_contents($url);
$json = json_decode($jsonData, true);
echo $json['response'][1]['price'] . "<br><br><br><br>";
echo '<pre>', print_r($json), '</pre>';
?>[/php]
So is there a way to call by the number of the index in json, or in lieu of that can I take the json info and convert it into a multidimensional array with numbers as the indexes?
Thanks for your time.