I´m trying to use the function but it is not working. <?php // set api key CallerFactory::getDefaultCaller()->setApiKey(API_KEY); $tracks = Geo::getTopTracks($country); echo "<ul>"; foreach($tracks as $key => $track) { echo "<li><div>"; echo "Track Number: " . ($key + 1) . "<br>"; echo "Title: " . $track->getName() . "<br>"; echo "Played: " . $track->getPlayCount() . " time(s)<br>"; echo "Duration: " . $track->getDuration() . " seconds<br>"; echo "Track URL: " . $track->getUrl() . "<br>"; echo "</div></li>"; } echo "</ul>"; ?>
I´m trying to use the function but it is not working.
setApiKey(API_KEY); $tracks = Geo::getTopTracks($country); echo ""; foreach($tracks as $key => $track) { echo "";
echo "Track Number: " . ($key + 1) . " ";
}
echo "
"; ?>"; echo "Title: " . $track->getName() . "
"; echo "Played: " . $track->getPlayCount() . " time(s)
"; echo "Duration: " . $track->getDuration() . " seconds
"; echo "Track URL: " . $track->getUrl() . "
"; echo "