Ich will aus folgendem Quelltext alles in eine Variable schreiben wo vorher echo steht, aber das geht net, wieso ?
Ich habe es mit
versucht ! Aber immer leer !
Code:
function streaminfo($file,$port) {
$fp = @fsockopen ($file, $port, &$errno, &$errstr, 5);
if (!$fp) {
echo "Could not connect to <b>{$file}:{$port}</b> ({$errno}) - {$errstr}\n";
} else {
fputs ($fp, "GET /7 HTTP/1.1\r\nUser-Agent:Mozilla\r\n\r\n");
while (!feof($fp)) {
$stream = fgets($fp,1024);
}
list(,$stream) = explode("<body>",$stream);
list($stream) = explode("</body>",$stream);
list($user, $status, $user_peak, $user_max, ,$bitrate, $song) = explode(",",$stream);
if($status=="0") {
echo "<b>{$file}:{$port}</b> is offline!";
} else {
echo "<b>{$file}:{$port} on air!</b><br><br>
<b>user still connected:</b> {$user} of {$user_max}<br>
<b>user peak:</b> {$user_peak}<br>
<b>bitrate:</b> {$bitrate} kbits/s<br>
<b>current song:</b> {$song}<br>";
}
fclose($fp);
}
}
Ich habe es mit
Code:
$description = "<b>{$file}:{$port} on air!</b><br><br>
<b>user still connected:</b> {$user} of {$user_max}<br>
<b>user peak:</b> {$user_peak}<br>
<b>bitrate:</b> {$bitrate} kbits/s<br>
<b>current song:</b> {$song}<br>";