json_decode を使用して作成したこの配列があります。これは私のコードです:
$obj = json_decode($json);
$results = $obj->{"results"}; // This selects the results section
echo $results[artistName];
$results は配列です
配列は次のようになります。
array(1) {
[0]=> object(stdClass)#5 (8) {
["wrapperType"]=> string(6) "artist"
["artistType"]=> string(6) "Artist"
["artistName"]=> string(5) "Human"
["artistLinkUrl"]=> string(56) "https://itunes.apple.com/us/artist/human/id35761368?uo=4"
["artistId"]=> int(35761368)
["amgArtistId"]=> int(1173165)
["primaryGenreName"]=> string(3) "Pop"
["primaryGenreId"]=> int(14)
}
}
しかし、それは何もエコーしません。助けてください。