", "", $data); $data = ereg_replace(".*", ",", $data); $data_array = explode(",",$data); switch($servertype){ case "shoutcast": $listeners = $data_array[0]; $status = $data_array[1]; $peak_listeners = $data_array[2]; $maximum_listeners = $data_array[3]; $unique_listeners = $data_array[4]; $bitrate = $data_array[5]; $track = $data_array[6]; break; case "icecast": $bitrate = "48k"; $unique_listeners = $data_array[15]; $track = $data_array[17]; break; } $title = chop($track); $select = explode(" - ",$title); $artist = chop($select[0]); if(count($select)<2){ $title = chop($select[0]); }else{ $title = chop($select[1]); } header ("content-type: text/xml"); echo "\n"; echo "\n"; echo " on\n"; echo " $unique_listeners\n"; echo " 0\n"; echo " $bitrate\n"; echo " \n"; echo " <![CDATA[$title]]>\n"; echo "\n"; }else{ header ("content-type: text/xml"); echo "\n"; echo "\n"; echo " off\n"; echo " 0\n"; echo " 0\n"; echo " 0\n"; echo " \n"; echo " <![CDATA[]]>\n"; echo "\n"; } ?>