Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help Decoding JSON

I'm trying to get the "screenshotUrls" string from this piece of json:

$request_url = 'http://itunes.apple.com/search?term=ibooks&country=us&entity=software&limit=1';
$json = file_get_contents($request_url);
$decode = json_decode($json, true);

echo $decode['results'][0]['screenshotUrls'];

But I get only text "Array"

What have I done wrong?

like image 389
andrew Avatar asked Dec 09 '25 03:12

andrew


1 Answers

Try

var_dump($decode['results'][0]['screenshotUrls']);

IF you get 'Array' output by PHP that means that you're trying to echo an actual array (or the string 'Array'...). That means you need to get a specific index value.

like image 111
cwallenpoole Avatar answered Dec 10 '25 17:12

cwallenpoole



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!