$cur_song = iconv('ISO-8859-1','UTF-8',$cur_song); echo' <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> </head> <body style="margin:0 0 0 0; background-color:#000; color:#fff"> <b><style="font-family:Arial; font-size:2;">В эфире: $cur_song</font></b> </body> </html>';
$mas[0] = iconv('Windows-1252','UTF-8',$mas[0]); echo $mas[0];
<?php $ip = "**.**.**.**"; //your server address in the form of mydomain.com or 192.161.1.1 $port = "8000"; //the port of your server $ice2_station = "Station"; // your station or stream name $fp = fsockopen("$ip", $port, &$errno, &$errstr, 30); //open connection if(!$fp) { $success=2; //set if no connection echo'<table> <tr> <td width="100%" colspan="2"> <img border="0" src="images/offline.gif" width="22" height="22"> <b><font face="Arial" size="2" color="#FF0000">'.$ice2_station.' is currently offline</font></b></td> </tr> </table>'; } if($success!=2){ fputs($fp,"GET /status2.xsl HTTP/1.0\r\nUser-Agent: Icecast2 XSL Parser (Mozilla Compatible)\r\n\r\n"); //get status2.xsl while(!feof($fp)) { $page .= fgets($fp, 1000); } fclose($fp); //close connection $page = ereg_replace(".*<pre>", "", $page); //extract data $page = ereg_replace("</pre>.*", ",", $page); //extract data $numbers = explode(",",$page); $mount = $numbers[0]; $connections = $numbers[1]; $stream_n = $numbers[2]; $listeners = $numbers[3]; $desc = $numbers[4]; $cur_song = $numbers[5]; $str_url = $numbers[6]; $client_info = $numbers[7]; $test1 = $numbers[8]; $test2 = $numbers[9]; $test3 = $numbers[10]; $mount = $numbers[11]; $connections = $numbers[12]; $station =$numbers[13]; $listeners = $numbers[14]; $description = $numbers[15]; $cur_song = $numbers[16]; $www_url = $numbers[17]; $cur_song = iconv('ISO-8859-1','UTF-8',$cur_song); echo ' <html> <head> <meta http-equiv="content-type" content="text/html; charset="UTF-8" /> </head> <tr> <font color="red">Сейчас играет</font> '.$cur_song.' </tr>'; } ?>