Script-PHP-Shoutcast Display current song

by Digital in Tutoriais on Maio 15, 2019

/*

Now Playing PHP script for SHOUTcast

Feel free to modify this free script
in any other way to suit your needs.

Version: v1.1

*/

/* ———– Server configuration ———- */

$ip = “123.456.789.10”;
$port = “8000”;

/* —– No need to edit below this line —– */
/* ——————————————- */
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
echo “Connection refused”; // Diaplays when sever is offline
}
else
{
fputs($fp, “GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n”);
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace(”, “”, $info);
$split = explode(‘,’, $info);
if (empty($split[6]) )
{
echo “The current song is not available”; // Diaplays when sever is online but no song title
}
else
{
$title = str_replace(‘\”, ‘`’, $split[6]);
$title = str_replace(‘,’, ‘ ‘, $title);
echo “$title”; // Diaplays song
}
}
?>

Express Your Reaction
Like
Love
Haha
Wow
Sad
Angry
You have reacted on "Script-PHP-Shoutcast Display current song" A few seconds ago

Categories: Tutoriais

Tags:

Latest Product

Share Your Valuable Opinions