本文整理汇总了PHP中Artists::get_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Artists::get_by_id方法的具体用法?PHP Artists::get_by_id怎么用?PHP Artists::get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Artists
的用法示例。
在下文中一共展示了Artists::get_by_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$tracks_array = array();
if ($tracks) {
foreach ($tracks as $track_id) {
$track_object = Tracks::get($track_id);
$track = array('id' => $track_object->get_id(), 'title' => $track_object->get_title(), 'by' => $track_object->get_artists_str(), 'href' => LINK_ABS . "music/detail/" . $track_object->get_id());
array_push($tracks_array, $track);
}
}
if ($query) {
$search = Search::artists($query, 5);
}
$artists = $search["results"];
$artists_array = array();
if ($artists) {
foreach ($artists as $artist) {
$artist_object = Artists::get_by_id($artist);
if ($artist_object) {
$artist = array('id' => $artist_object->get_id(), 'title' => $artist_object->get_name(), 'href' => LINK_ABS . "music/search/?q=%22" . urlencode($artist_object->get_name()) . "%22&i=artist");
array_push($artists_array, $artist);
}
}
}
if ($query) {
$search = Search::albums($query, 5);
}
$albums = $search["results"];
$albums_array = array();
if ($albums) {
foreach ($albums as $album) {
$album_object = Albums::get_by_id($album);
if ($album_object) {