0

我正在寻找类似 cURL 的东西来从 Discogs API 获取封面图片。

https://api.discogs.com/database/search?q=Rose%20Laurens%20-%20Quand%20Tu%20Pars%20(12``%20Version)&key=XXXXXX&secret=XXXXXXX

我有这个输出:

{"pagination": {"page": 1, "pages": 1, "per_page": 50, "items": 5, "urls": {}}, "results": [{"country": "Germany", "year": "1986", "format": ["Vinyl", "12\"", "45 RPM"], "label": ["WEA", "WEA Musik GmbH", "WEA Filipacchi Music"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Disco", "Synth-pop"], "id": 598957, "barcode": ["LC 4281", "GEMA BIEM", "France: WE 221"], "master_id": 73508, "master_url": "https://api.discogs.com/masters/73508", "uri": "/Rose-Laurens-American-Love-Extended-Version/release/598957", "catno": "248 812-0", "title": "Rose Laurens - American Love (Extended Version)", "thumb": "https://img.discogs.com/juSxuRz0lhvMOQu9jsZAK_7uKKc=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-598957-1572721294-8254.jpeg.jpg", "cover_image": "https://img.discogs.com/JcL8GoCbo19zvyqUS57KRgB-81Q=/fit-in/600x594/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-598957-1572721294-8254.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/598957", "community": {"want": 70, "have": 273}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM"]}]}, {"country": "Italy", "year": "1987", "format": ["Vinyl", "12\"", "45 RPM", "Stereo"], "label": ["Limited Edition Records", "Flarenasch", "Limited Edition Records", "Flarenasch"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Europop", "Synth-pop"], "id": 774544, "barcode": ["LE 011 A", "LE 011 B", "S.I.A.E."], "master_id": 73508, "master_url": "https://api.discogs.com/masters/73508", "uri": "/Rose-Laurens-American-Love-Remix/release/774544", "catno": "LE 011", "title": "Rose Laurens - American Love (Remix)", "thumb": "https://img.discogs.com/xuiciV7XSJhYLyrPPGlsPKRk9l8=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-774544-1324833177.jpeg.jpg", "cover_image": "https://img.discogs.com/FqsCJjI7k_5NQlqlyqr4jSe_2xs=/fit-in/600x602/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-774544-1324833177.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/774544", "community": {"want": 32, "have": 59}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM", "Stereo"]}]}, {"country": "France", "year": "2019", "format": ["CD", "Compilation", "Limited Edition", "Mispress", "Remastered"], "label": ["CD Rare", "Flarenasch", "Wagram Music", "Wagram Music", "Arnaud Ralite", "Wagram Music", "Arnaud Ralite"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Chanson", "Synth-pop"], "id": 13640144, "barcode": ["3 300610 913675", "91367-1 Rose Laurens - The Collection Volume 2 CD1", "91367-2 Rose Laurens - The Collection Volume 2 CD2", "91367-3 Rose Laurens - The Collection Volume 2 CD3", "SACEM/SDRM"], "master_id": 1550622, "master_url": "https://api.discogs.com/masters/1550622", "uri": "/Rose-Laurens-Collection-Volume-2/release/13640144", "catno": "91367", "title": "Rose Laurens - Collection Volume 2", "thumb": "https://img.discogs.com/klSxa3id_sf6FYiIT8Qg1VaPVfc=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg", "cover_image": "https://img.discogs.com/WxmEZdN53iyv5dYDO1pjQ5i05A4=/fit-in/600x510/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/13640144", "community": {"want": 14, "have": 6}, "format_quantity": 3, "formats": [{"name": "CD", "qty": "3", "descriptions": ["Compilation", "Limited Edition", "Mispress", "Remastered"]}]}, {"country": "France", "year": "1988", "format": ["Vinyl", "12\"", "45 RPM", "Maxi-Single"], "label": ["Wall Street Music", "Wall Street Music", "Carrere"], "type": "release", "genre": ["Electronic"], "style": ["Downtempo", "Synth-pop"], "id": 1232281, "barcode": ["3 298640 088992", "3298640088992", "SACEM SACD SDRM SGDL", "CA 618"], "master_id": 0, "master_url": null, "uri": "/Valerie-Cannon-Hold-Me-Forever/release/1232281", "catno": "8 889", "title": "Valerie Cannon* - Hold Me Forever", "thumb": "https://img.discogs.com/8kFEPBZySlmL0qCQaEmXeqguZhs=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-1232281-1278797697.jpeg.jpg", "cover_image": "https://img.discogs.com/pvi47AKIm2DEK79VuepELR3-X6Y=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-1232281-1278797697.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/1232281", "community": {"want": 9, "have": 36}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM", "Maxi-Single"]}]}, {"country": "Germany", "year": "2011", "format": ["CD", "Compilation", "Remastered"], "label": ["Sony Music", "Neue Oldies Braucht Das Land"], "type": "release", "genre": ["Electronic", "Rock", "Pop"], "style": ["Pop Rock", "Synth-pop", "Vocal", "Symphonic Rock"], "id": 2674622, "barcode": ["8 86978 30492 6", "LC 10879", "B.I.E.M. / GEMA"], "master_id": 0, "master_url": null, "uri": "/Various-Neue-Oldies-Braucht-Das-Land-Vol2-Hits-Rarit%C3%A4ten-Der-80er/release/2674622", "catno": "88697 83049 2", "title": "Various - Neue Oldies Braucht Das Land Vol.2 - Hits & Rarit\u00e4ten Der 80er", "thumb": "https://img.discogs.com/TpbpB5QGrfNr0jE2w89S93VfD_U=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-2674622-1322578324.jpeg.jpg", "cover_image": "https://img.discogs.com/-ax4nZ4tmeBjQeTNEw-OSBpPDrQ=/fit-in/400x400/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-2674622-1322578324.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/2674622", "community": {"want": 13, "have": 47}, "format_quantity": 2, "formats": [{"name": "CD", "qty": "2", "descriptions": ["Compilation", "Remastered"]}]}]}

并且只需要这一行来显示:

https://img.discogs.com/JcL8GoCbo19zvyqUS57KRgB-81Q=/fit-in/600x594/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-598957-1572721294-8254.jpeg.jpg

感谢帮助。

4

3 回答 3

0
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.discogs.com/database/search?q=Nirvana&f=json');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$headers = array();
$headers[] = 'Authorization: Discogs token=uEkEqsZLjqTlPnUwZmzdPZlimbyWFbctrQkbowXT';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$json = curl_exec($ch);
curl_close($ch);

$data = json_decode($json, true);
foreach ($data['results'] as $result) {
    echo $result['cover_image'] . PHP_EOL;
}

我做错了什么?

于 2021-03-27T18:36:03.270 回答
0

这个脚本将帮助你
如果你想将 json 转换为 php 数组,你可以使用json_decode($json, true);

<?php

$json = '{"pagination": {"page": 1, "pages": 1, "per_page": 50, "items": 5, "urls": {}}, "results": [{"country": "Germany", "year": "1986", "format": ["Vinyl", "12\"", "45 RPM"], "label": ["WEA", "WEA Musik GmbH", "WEA Filipacchi Music"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Disco", "Synth-pop"], "id": 598957, "barcode": ["LC 4281", "GEMA BIEM", "France: WE 221"], "master_id": 73508, "master_url": "https://api.discogs.com/masters/73508", "uri": "/Rose-Laurens-American-Love-Extended-Version/release/598957", "catno": "248 812-0", "title": "Rose Laurens - American Love (Extended Version)", "thumb": "https://img.discogs.com/juSxuRz0lhvMOQu9jsZAK_7uKKc=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-598957-1572721294-8254.jpeg.jpg", "cover_image": "https://img.discogs.com/JcL8GoCbo19zvyqUS57KRgB-81Q=/fit-in/600x594/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-598957-1572721294-8254.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/598957", "community": {"want": 70, "have": 273}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM"]}]}, {"country": "Italy", "year": "1987", "format": ["Vinyl", "12\"", "45 RPM", "Stereo"], "label": ["Limited Edition Records", "Flarenasch", "Limited Edition Records", "Flarenasch"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Europop", "Synth-pop"], "id": 774544, "barcode": ["LE 011 A", "LE 011 B", "S.I.A.E."], "master_id": 73508, "master_url": "https://api.discogs.com/masters/73508", "uri": "/Rose-Laurens-American-Love-Remix/release/774544", "catno": "LE 011", "title": "Rose Laurens - American Love (Remix)", "thumb": "https://img.discogs.com/xuiciV7XSJhYLyrPPGlsPKRk9l8=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-774544-1324833177.jpeg.jpg", "cover_image": "https://img.discogs.com/FqsCJjI7k_5NQlqlyqr4jSe_2xs=/fit-in/600x602/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-774544-1324833177.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/774544", "community": {"want": 32, "have": 59}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM", "Stereo"]}]}, {"country": "France", "year": "2019", "format": ["CD", "Compilation", "Limited Edition", "Mispress", "Remastered"], "label": ["CD Rare", "Flarenasch", "Wagram Music", "Wagram Music", "Arnaud Ralite", "Wagram Music", "Arnaud Ralite"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Chanson", "Synth-pop"], "id": 13640144, "barcode": ["3 300610 913675", "91367-1 Rose Laurens - The Collection Volume 2 CD1", "91367-2 Rose Laurens - The Collection Volume 2 CD2", "91367-3 Rose Laurens - The Collection Volume 2 CD3", "SACEM/SDRM"], "master_id": 1550622, "master_url": "https://api.discogs.com/masters/1550622", "uri": "/Rose-Laurens-Collection-Volume-2/release/13640144", "catno": "91367", "title": "Rose Laurens - Collection Volume 2", "thumb": "https://img.discogs.com/klSxa3id_sf6FYiIT8Qg1VaPVfc=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg", "cover_image": "https://img.discogs.com/WxmEZdN53iyv5dYDO1pjQ5i05A4=/fit-in/600x510/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/13640144", "community": {"want": 14, "have": 6}, "format_quantity": 3, "formats": [{"name": "CD", "qty": "3", "descriptions": ["Compilation", "Limited Edition", "Mispress", "Remastered"]}]}, {"country": "France", "year": "1988", "format": ["Vinyl", "12\"", "45 RPM", "Maxi-Single"], "label": ["Wall Street Music", "Wall Street Music", "Carrere"], "type": "release", "genre": ["Electronic"], "style": ["Downtempo", "Synth-pop"], "id": 1232281, "barcode": ["3 298640 088992", "3298640088992", "SACEM SACD SDRM SGDL", "CA 618"], "master_id": 0, "master_url": null, "uri": "/Valerie-Cannon-Hold-Me-Forever/release/1232281", "catno": "8 889", "title": "Valerie Cannon* - Hold Me Forever", "thumb": "https://img.discogs.com/8kFEPBZySlmL0qCQaEmXeqguZhs=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-1232281-1278797697.jpeg.jpg", "cover_image": "https://img.discogs.com/pvi47AKIm2DEK79VuepELR3-X6Y=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-1232281-1278797697.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/1232281", "community": {"want": 9, "have": 36}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM", "Maxi-Single"]}]}, {"country": "Germany", "year": "2011", "format": ["CD", "Compilation", "Remastered"], "label": ["Sony Music", "Neue Oldies Braucht Das Land"], "type": "release", "genre": ["Electronic", "Rock", "Pop"], "style": ["Pop Rock", "Synth-pop", "Vocal", "Symphonic Rock"], "id": 2674622, "barcode": ["8 86978 30492 6", "LC 10879", "B.I.E.M. / GEMA"], "master_id": 0, "master_url": null, "uri": "/Various-Neue-Oldies-Braucht-Das-Land-Vol2-Hits-Rarit%C3%A4ten-Der-80er/release/2674622", "catno": "88697 83049 2", "title": "Various - Neue Oldies Braucht Das Land Vol.2 - Hits & Rarit\u00e4ten Der 80er", "thumb": "https://img.discogs.com/TpbpB5QGrfNr0jE2w89S93VfD_U=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-2674622-1322578324.jpeg.jpg", "cover_image": "https://img.discogs.com/-ax4nZ4tmeBjQeTNEw-OSBpPDrQ=/fit-in/400x400/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-2674622-1322578324.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/2674622", "community": {"want": 13, "have": 47}, "format_quantity": 2, "formats": [{"name": "CD", "qty": "2", "descriptions": ["Compilation", "Remastered"]}]}]}';
    
$data = json_decode($json, true);
foreach ($data['results'] as $result) {
    echo $result['cover_image'] . PHP_EOL;
}

输出

https://img.discogs.com/JcL8GoCbo19zvyqUS57KRgB-81Q=/fit-in/600x594/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-598957-1572721294-8254.jpeg.jpg<br>https://img.discogs.com/FqsCJjI7k_5NQlqlyqr4jSe_2xs=/fit-in/600x602/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-774544-1324833177.jpeg.jpg<br>https://img.discogs.com/WxmEZdN53iyv5dYDO1pjQ5i05A4=/fit-in/600x510/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg<br>https://img.discogs.com/pvi47AKIm2DEK79VuepELR3-X6Y=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-1232281-1278797697.jpeg.jpg<br>https://img.discogs.com/-ax4nZ4tmeBjQeTNEw-OSBpPDrQ=/fit-in/400x400/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-2674622-1322578324.jpeg.jpg<br>
于 2021-03-21T15:20:03.277 回答
0

您必须使用json_decode(),然后遍历result数组并访问->cover_image成员。

<?php

    $json = '{"pagination": {"page": 1, "pages": 1, "per_page": 50, "items": 5, "urls": {}}, "results": [{"country": "Germany", "year": "1986", "format": ["Vinyl", "12\"", "45 RPM"], "label": ["WEA", "WEA Musik GmbH", "WEA Filipacchi Music"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Disco", "Synth-pop"], "id": 598957, "barcode": ["LC 4281", "GEMA BIEM", "France: WE 221"], "master_id": 73508, "master_url": "https://api.discogs.com/masters/73508", "uri": "/Rose-Laurens-American-Love-Extended-Version/release/598957", "catno": "248 812-0", "title": "Rose Laurens - American Love (Extended Version)", "thumb": "https://img.discogs.com/juSxuRz0lhvMOQu9jsZAK_7uKKc=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-598957-1572721294-8254.jpeg.jpg", "cover_image": "https://img.discogs.com/JcL8GoCbo19zvyqUS57KRgB-81Q=/fit-in/600x594/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-598957-1572721294-8254.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/598957", "community": {"want": 70, "have": 273}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM"]}]}, {"country": "Italy", "year": "1987", "format": ["Vinyl", "12\"", "45 RPM", "Stereo"], "label": ["Limited Edition Records", "Flarenasch", "Limited Edition Records", "Flarenasch"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Europop", "Synth-pop"], "id": 774544, "barcode": ["LE 011 A", "LE 011 B", "S.I.A.E."], "master_id": 73508, "master_url": "https://api.discogs.com/masters/73508", "uri": "/Rose-Laurens-American-Love-Remix/release/774544", "catno": "LE 011", "title": "Rose Laurens - American Love (Remix)", "thumb": "https://img.discogs.com/xuiciV7XSJhYLyrPPGlsPKRk9l8=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-774544-1324833177.jpeg.jpg", "cover_image": "https://img.discogs.com/FqsCJjI7k_5NQlqlyqr4jSe_2xs=/fit-in/600x602/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-774544-1324833177.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/774544", "community": {"want": 32, "have": 59}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM", "Stereo"]}]}, {"country": "France", "year": "2019", "format": ["CD", "Compilation", "Limited Edition", "Mispress", "Remastered"], "label": ["CD Rare", "Flarenasch", "Wagram Music", "Wagram Music", "Arnaud Ralite", "Wagram Music", "Arnaud Ralite"], "type": "release", "genre": ["Electronic", "Pop"], "style": ["Chanson", "Synth-pop"], "id": 13640144, "barcode": ["3 300610 913675", "91367-1 Rose Laurens - The Collection Volume 2 CD1", "91367-2 Rose Laurens - The Collection Volume 2 CD2", "91367-3 Rose Laurens - The Collection Volume 2 CD3", "SACEM/SDRM"], "master_id": 1550622, "master_url": "https://api.discogs.com/masters/1550622", "uri": "/Rose-Laurens-Collection-Volume-2/release/13640144", "catno": "91367", "title": "Rose Laurens - Collection Volume 2", "thumb": "https://img.discogs.com/klSxa3id_sf6FYiIT8Qg1VaPVfc=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg", "cover_image": "https://img.discogs.com/WxmEZdN53iyv5dYDO1pjQ5i05A4=/fit-in/600x510/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-13640144-1558082772-3926.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/13640144", "community": {"want": 14, "have": 6}, "format_quantity": 3, "formats": [{"name": "CD", "qty": "3", "descriptions": ["Compilation", "Limited Edition", "Mispress", "Remastered"]}]}, {"country": "France", "year": "1988", "format": ["Vinyl", "12\"", "45 RPM", "Maxi-Single"], "label": ["Wall Street Music", "Wall Street Music", "Carrere"], "type": "release", "genre": ["Electronic"], "style": ["Downtempo", "Synth-pop"], "id": 1232281, "barcode": ["3 298640 088992", "3298640088992", "SACEM SACD SDRM SGDL", "CA 618"], "master_id": 0, "master_url": null, "uri": "/Valerie-Cannon-Hold-Me-Forever/release/1232281", "catno": "8 889", "title": "Valerie Cannon* - Hold Me Forever", "thumb": "https://img.discogs.com/8kFEPBZySlmL0qCQaEmXeqguZhs=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-1232281-1278797697.jpeg.jpg", "cover_image": "https://img.discogs.com/pvi47AKIm2DEK79VuepELR3-X6Y=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-1232281-1278797697.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/1232281", "community": {"want": 9, "have": 36}, "format_quantity": 1, "formats": [{"name": "Vinyl", "qty": "1", "descriptions": ["12\"", "45 RPM", "Maxi-Single"]}]}, {"country": "Germany", "year": "2011", "format": ["CD", "Compilation", "Remastered"], "label": ["Sony Music", "Neue Oldies Braucht Das Land"], "type": "release", "genre": ["Electronic", "Rock", "Pop"], "style": ["Pop Rock", "Synth-pop", "Vocal", "Symphonic Rock"], "id": 2674622, "barcode": ["8 86978 30492 6", "LC 10879", "B.I.E.M. / GEMA"], "master_id": 0, "master_url": null, "uri": "/Various-Neue-Oldies-Braucht-Das-Land-Vol2-Hits-Rarit%C3%A4ten-Der-80er/release/2674622", "catno": "88697 83049 2", "title": "Various - Neue Oldies Braucht Das Land Vol.2 - Hits & Rarit\u00e4ten Der 80er", "thumb": "https://img.discogs.com/TpbpB5QGrfNr0jE2w89S93VfD_U=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-2674622-1322578324.jpeg.jpg", "cover_image": "https://img.discogs.com/-ax4nZ4tmeBjQeTNEw-OSBpPDrQ=/fit-in/400x400/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-2674622-1322578324.jpeg.jpg", "resource_url": "https://api.discogs.com/releases/2674622", "community": {"want": 13, "have": 47}, "format_quantity": 2, "formats": [{"name": "CD", "qty": "2", "descriptions": ["Compilation", "Remastered"]}]}]}';
    
        
    $data = json_decode($json);
    foreach ($data->results as $result) {
        echo $result->cover_image . "<br>";
    }
于 2021-03-21T15:05:22.707 回答