Server ist Offline
PHP-Source:
<html>
<head>
<title>Shoutcast-Serverinformationen mit PHP</title>
</head>
<body>
<?php

$attr=array(
  'Server Status'=>1,
  'Stream Status'=>1,
  'Listener Peak'=>1,
  'Average Listen Time'=>1,
  'Stream Title'=>1,
  'Content Type'=>1,
  'Stream Genre'=>1,
  'Stream URL'=>1,
  'Stream ICQ'=>1,
  'Stream AIM'=>1,
  'Stream IRC'=>1,
  'Current Song'=>1
);

$host = '88.191.78.249';
$port = '8000';
$fp = @fsockopen($host, $port, $errno, $errstr, 01);

if(!$fp)
  {
    $status = "Offline";
  }
else
  {
  $page='';
  $status = "Online";
  fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: Stern-Recorder@DM (Mozilla Compatible)\r\n\r\n");
  while(!feof($fp))
    {
      $page .= fgets($fp, 1000);
    }
  fclose($fp);

  preg_match_all('|<table[^>]*align=center><tr>(.*)</tr></table>|s',$page,$page);
  preg_match_all('#<tr><td[^>]*>.*('.implode('|',array_keys($attr)).').*</td><td[^>]*>(.*)</td></tr>#Us',$page[0][0],$rows,PREG_SET_ORDER);
  }

?>

  <table border="0" cellpadding="3" align="center">
    <?php
      if($status=='Online')
      {
        foreach($rows as $row)
          {
            if(!$attr[$row[1]])continue;
            echo '<tr><td align="right">'.$row[1].':</td><td>'.$row[2].'</td></tr>';
          }
      }
      else
      {
          ?>
          <tr><td colspan="2">Server ist Offline</td></tr>
          <?
      }
    ?>
  </table>
</body>
</html>