PHP code example of intellexapps / shoutcast

1. Go to this page and download the library: Download intellexapps/shoutcast library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

intellexapps / shoutcast example snippets




// Load the info
$streamURL = "https://8.8.8.8:8080/stream";
$streamInfo = \Intellex\SHOUTcast\Info::parse($streamURL);

// Use the info
$streamInfo->isOnline();               // True if the stream is running, false otherwise 
$streamInfo->currentListeners();       // The number of currently active listeners
$streamInfo->uniqueCurrentListeners(); // The number of currently connected unique clients
$streamInfo->peakListeners();          // The maximum number of simultaneous listeners ever
$streamInfo->maxConnections();         // The maximum number of connections supported by this stream
$streamInfo->quality();                // The quality of the stream, as bitrate
$streamInfo->onAir();                  // The name of the current song or show (can be null)


$rawInfo = file_get_contents("https://8.8.8.8:8080/7.html");
$streamInfo = \Intellex\SHOUTcast\Info::parseStreamURL($rawInfo);

// $streamInfo is the same as in the example above