[GH-ISSUE #44] Outdated documentation #25

Closed
opened 2026-02-27 19:25:40 +03:00 by kerem · 0 comments
Owner

Originally created by @simoheinonen on GitHub (Mar 12, 2016).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/44

In http://jwilsson.github.io/spotify-web-api-php/examples/getting-objects.html

Getting an artist’s top tracks

<?php
$tracks = $api->getArtistTopTracks('6v8FB84lnmJs434UJf2Mrm', 'se');

foreach ($tracks->tracks as $track) {
    echo '<b>' . $track->name . '</b> <br>';
}

should be

<?php
$tracks = $api->getArtistTopTracks('6v8FB84lnmJs434UJf2Mrm', ['country' => 'se']);

foreach ($tracks->tracks as $track) {
    echo '<b>' . $track->name . '</b> <br>';
}
Originally created by @simoheinonen on GitHub (Mar 12, 2016). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/44 In http://jwilsson.github.io/spotify-web-api-php/examples/getting-objects.html ## Getting an artist’s top tracks ``` php <?php $tracks = $api->getArtistTopTracks('6v8FB84lnmJs434UJf2Mrm', 'se'); foreach ($tracks->tracks as $track) { echo '<b>' . $track->name . '</b> <br>'; } ``` should be ``` php <?php $tracks = $api->getArtistTopTracks('6v8FB84lnmJs434UJf2Mrm', ['country' => 'se']); foreach ($tracks->tracks as $track) { echo '<b>' . $track->name . '</b> <br>'; } ```
kerem closed this issue 2026-02-27 19:25:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#25
No description provided.