0

Good, again I ask your help.

I have a php echo in I want to take the "artworkUrl100" the Itunes music that the code indicates this case (Selena Gomez - Kill Em With Kindness) but I am not able to get that specific information, showing an error.

I would also like to increase the image of 100x100 to 400x400 but in the iTunes feature is not that option.

I leave the code drafted to try to realize my mistake.

<?php
$xml = simplexml_load_file('http://radiojoven.6te.net/nowplaying2.xml');
$track1 = urlencode($xml->OnAir->Agora->Artista);
$track = urlencode($xml->OnAir->Agora->Titulo);
$songs = file_get_contents('https://itunes.apple.com/search?term=".$track1."'+".$track."&amp;entity=song&amp;sort=popular');


    foreach ($songs['results'] as $key => $song) {
        if($song['trackName'] == 'artworkUrl100') {
            echo sprintf('<img src="%s" />', $song['artworkUrl100'])."\n";
        }
    }
?>

error message: Parse error: syntax error, unexpected ';' in /home/vhosts/radiojoven.6te.net/teste1.php on line 5

From already thank you very much for your help!

Andy Cruz
  • 87
  • 9

0 Answers0