Titletest

‘method’ => ‘GET’,
‘header’ => ‘Icy-MetaData: 1’,
‘user_agent’ => $ua
]
];

if (($headers = get_headers($streamingUrl))) {
foreach ($headers as $h) {
if (strpos(strtolower($h), ‘icy-metaint’) !== false && ($interval = explode(‘:’, $h)[1])) {
break;
}
}
}

$context = stream_context_create($opts);

if ($stream = fopen($streamingUrl, ‘r’, false, $context)) {
$buffer = stream_get_contents($stream, $interval, $offset);
fclose($stream);

if (strpos($buffer, $needle) !== false) {
$title = explode($needle, $buffer)[1];
return substr($title, 1, strpos($title, ‘;’) – 2);
} else {
return getMp3StreamTitle($streamingUrl, $interval, $offset + $interval, false);
}
} else {
throw new Exception(“Unable to open stream [{$streamingUrl}]”);
}
}

var_dump(getMp3StreamTitle(‘http://str30.creacast.com/r101_thema6’, 19200));

FAT Music Fit to Bust Just for You