Closed DarKl4ne closed 4 years ago
Can you post the code snippet for it?
Here is the display for research
foreach ($results->albums->items as $album) {
//echo 'Titre: '.$album->images, '<br>';
echo 'Titre: '.$album->name, '<br>';
echo 'Date: '.$album->release_date, '<br>';
echo 'Nombre de piste: '.$album->total_tracks, '<br>';
echo $album['images']['1']->url;
}
Dans l'adresse api les images sont déjà dans array qui est items
[items] => Array
(
**"Information that I collect"**
[images] => Array
(
[0] => stdClass Object
(
[height] => 640
[url] => https://i.scdn.co/image/ab67616d0000b273614c5f63afef27e4dfa9f596
[width] => 640
)
[1] => stdClass Object
(
[height] => 300
[url] => https://i.scdn.co/image/ab67616d00001e02614c5f63afef27e4dfa9f596
[width] => 300
)
[2] => stdClass Object
(
[height] => 64
[url] => https://i.scdn.co/image/ab67616d00004851614c5f63afef27e4dfa9f596
[width] => 64
)
)
So I would like to know how to retrieve information from an array which is already in an array
thank you
$album
is a stdClass
, so try:
$album->images['1']->url;
Thank you very much it works
I was not far away I had done like this echo $album['images']['1']->url;
Glad you got it working!
And thanks @adamazad for helping out!
Hello
I wanted to know how we can get the address of the image when we do an album search. I tried but still have an array error. So i can't do it
thank you for your help