答案 0 :(得分:1)
嗯,这应该是相当简单的:
<?php
function get_content($URL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
//$json = file_get_contents("http://api.laut.fm/station/radiojfm/current_song");
$json = get_content("http://api.laut.fm/station/radiojfm/current_song");
$data = json_decode($json, true);
echo $data["title"]." ".$data["album"];
?>