首页 音乐电台 音乐电台示例代码 搜索歌曲[PHP]

搜索歌曲示例代码[PHP]

作者: 阅读数:896 上传时间:2016-03-10

搜索歌曲

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$tagid = 696;
$url = "https://api.jisuapi.com/hifimusic/search?appkey=$appkey&tagid=696";
$result = curlOpen($url, ['ssl'=>true]);

$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
;
foreach($result['list'] as $key=>$val)
{
	echo $val['0'].' '.$val['songid'].' '.$val['musicname'].' '.$val['albumid'].' '.$val['albumname'].' '.$val['duration'].' '.$val['auditionbegin'].' '.$val['auditionend'].' '.$val['bpm'].' '.$val['picurl'].' '.$val['ismajorversion'].' '.$val['taglist'].' '.$val['artistlist'].' '.$val['authorlist'].' '.$val['composerlist'].' '.$val['arrangerlist'];
}