Dobrý den potřebuji aby se my vypsali všechny hodnoty (host, port, adminpass) skoušel jsem to přes [$i] ale vypisuje se mi pořád jen jedna nevíte jak na to ?
<?php
$host[1] = "sc.fiveradio.cz";
$port[1] = "8000";
$adminpass[1] = "FIVE_radio";
$host[2] = "sc.fiveradio.cz";
$port[2] = "8002";
$adminpass[2] = "FIVE_radio";
$i = "1";
$fp = fsockopen ($host[$i], $port[$i], $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET /admin.cgi?pass={$adminpass[$i]}&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while (!feof($fp)) {
$content .= fgets ($fp,128);
}
}
fclose ($fp);
$i++;
$status = explode('<STREAMSTATUS>',$content);
$status = explode('</STREAMSTATUS>',$status[1]);
if($status[0] == 0)
{
die('spojení přerušeno');
}
$listeners = explode('<CURRENTLISTENERS>',$content);
$listeners = explode('</CURRENTLISTENERS>',$listeners[1]);
$serverurl = explode('<SERVERURL>',$content);
$serverurl = explode('</SERVERURL>',$serverurl[1]);
$maxlisteners = explode('<MAXLISTENERS>',$content);
$maxlisteners = explode('</MAXLISTENERS>',$maxlisteners[1]);
$servertitle = explode('<SERVERTITLE>',$content);
$servertitle = explode('</SERVERTITLE>',$servertitle[1]);
$servergenre = explode('<SERVERGENRE>',$content);
$servergenre = explode('</SERVERGENRE>',$servergenre[1]);
echo " {$listeners[0]} / {$maxlisteners[0]}<br><br>";
echo " {$servertitle[0]}<br><br>";
echo "{$serverurl[0]}<br><br>";
echo "$servergenre[0]<br>";
?>