首页 音乐电台 音乐电台示例代码 获取完整歌曲[PHP]

获取完整歌曲示例代码[PHP]

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

获取完整歌曲

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$songid = 'B7B810B053D7'
$url = "https://api.jisuapi.com/hifimusic/songdetail?appkey=$appkey&songid=$songid";
$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'];
echo $result['fileurl'].' '.$result['songid'];