Php Icecast无线电状态不工作

Php Icecast无线电状态不工作,php,icecast,Php,Icecast,所以我在忙这个网站,它需要一个收音机。他们使用的是icecast服务器,所以我从互联网上获取了icecast状态: <?php $icecast_url='http://178.32.13.195:8002'; $output = file_get_contents($icecast_url); $search='#<div class="newscontent">.*?Point /(.*?)<.*?href="(.*?)">M3U<.*?Lis

所以我在忙这个网站,它需要一个收音机。他们使用的是icecast服务器,所以我从互联网上获取了icecast状态:

    <?php
$icecast_url='http://178.32.13.195:8002';

$output = file_get_contents($icecast_url);

$search='#<div class="newscontent">.*?Point /(.*?)<.*?href="(.*?)">M3U<.*?Listeners.*?class="streamdata">(.*?)<.*?Song:.*?class="streamdata">(.*?)<.*?</div>#si';
preg_match_all($search, $output, $matches);

$j=count($matches[0]);
for ($i=0;$i<$j; $i++) {

    $point_name=$matches[1][$i];
    $pount_m3u=$icecast_url.$matches[2][$i];
    $point_listners_count=$matches[3][$i];
    $point_current_song=$matches[4][$i];
//
    echo 'mount point: <b>'.$point_name.'</b>
';
    echo 'm3u: <a href="'.$pount_m3u.'">'.$pount_m3u.'</a>
';
    echo 'listners_count: <b>'.$point_listners_count.'</b>
';
    echo 'point_current_song: <b>'. $point_current_song.'</b>


';
}
?>

但它不起作用。它只显示一个空白页。你们有谁知道怎么了吗


谢谢

他们正在使用Icecast 2.4.0,它有一个重新设计的管理界面,这打破了你的解析代码。 请不要试图解析html,每当他们更新Icecast和html更改时,它就会中断。 相反,您可以尝试新引入的status-json.xsl,即对于此服务器,它位于此处:
http://178.32.13.195:8002/status-json.xsl


请注意,不幸的是,由于json xslt中的错误,这不是有效的json。此问题在Icecast 2.4.1中已修复,因此如果您有权访问服务器,您可以很快更新到Icecast 2.4.1(可能在几周后可用)。如果您没有访问服务器的权限,您就无能为力,但解析HTML是最糟糕的方法。

否,您是否遇到任何错误?在你打开
一个被多次烧伤手指的人的建议后,将错误报告添加到你的文件顶部-“不要刮屏幕,你将遭受比你想象的更大的痛苦…”JayBlanchard Nope,仍然是一个空白页。2.4.1已经发布,分发包正在变得可用。