this ist my JSON File. I'am going to parse the "Titel" and the "Album" in PHP so:
Current Song: Titel (Album)
How can I make this with PHP? Can anybody post me the full PHP File?
this ist my JSON File. I'am going to parse the "Titel" and the "Album" in PHP so:
Current Song: Titel (Album)
How can I make this with PHP? Can anybody post me the full PHP File?
well, this should be rather straightforward:
<?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"];
?>