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?
Since
$decode['results']['0']['screenshotUrls']is an array, if you want just a string (say, delimited by commas), you could useThis will iterate over the array, and return a comma-separated string of all the URLs.