Hey leute, ich habe aus dem Forum hier den Code zum auslesen des Shoutcast Streamservers, nun habe ich die ausgabe vom Text verändert und als grafik erscheinen lassen. nun habe ich aber das problem, dass die umlaute wie ä ö ü und ß nicht angezeigt werden sondern in anderer formation auftauchen.
im phpforum wollt man mir nicht wirklich helfen drum versuch ich das hier... woran könnt das liegen? in der xml wird alles sauber angezeigt
hier nochma der code (schon mit grafik verändert)
wie bzw was müsst ich ändern, umdass die umlaute sichtbar werden und nicht in anderer formation stehen?
im phpforum wollt man mir nicht wirklich helfen drum versuch ich das hier... woran könnt das liegen? in der xml wird alles sauber angezeigt

hier nochma der code (schon mit grafik verändert)
PHP:
include("../config.ini.php");
// XML holen
if($fp = @fsockopen($scast_host, $scast_port, $errno, $errstr, 30)) {
if(fputs($fp, "GET /admin.cgi?pass=".$scast_pass."&mode=viewxml HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n")) {
$xmldata = "";
while(!feof($fp)) $xmldata .= fgets($fp, 1000);
$xmldata = explode("\r\n", $xmldata);
$xmldata = $xmldata[3];
}
}
// Regex Funktionen
function get_item9760($name, $source) {
preg_match('#<'.$name.'>(.*?)</'.$name.'>#', $source, $matches);
return $matches[1];
}
function get_item9760s($name, $source) {
preg_match_all('#<'.$name.'>(.*?)</'.$name.'>#', $source, $matches);
return $matches[1];
}
// Werte aus XML auslesen
$sc_stream_status = get_item9760("STREAMSTATUS", $xmldata);
if($sc_stream_status) {
$sc_stream_bitrate = get_item9760("BITRATE", $xmldata);
$sc_listeners_cur = get_item9760("CURRENTLISTENERS", $xmldata);
$sc_listeners_peak = get_item9760("PEAKLISTENERS", $xmldata);
$sc_listeners_max = get_item9760("MAXLISTENERS", $xmldata);
$sc_server_title = get_item9760("SERVERTITLE", $xmldata);
$sc_server_url = get_item9760("SERVERURL", $xmldata);
$sc_server_genre = get_item9760("SERVERGENRE", $xmldata);
$sc_server_version = get_item9760("VERSION", $xmldata);
$sc_current_song = get_item9760("SONGTITLE", $xmldata);
$sc_irc = get_item9760("IRC", $xmldata);
$sc_icq = get_item9760("ICQ", $xmldata);
$sc_aim = get_item9760("AIM", $xmldata);
$sc_type = get_item9760("CONTENT", $xmldata);
$sc_uni = get_item9760("REPORTEDLISTENERS", $xmldata);
}
if(!($sc_stream_bitrate)) {
header('Content-type: image/png');
$image = @imagecreate(400, 60);
imagecolorallocate($image, $a, $b, $c);
$text_color = imagecolorallocate($image, 0, 51, 102);
imagestring($image, 30, 5, 5, 'Offline', $text_color);
imagepng($image);
}
else {
header('Content-type: image/png');
$image = @imagecreate(555, 175);
imagecolorallocate($image, $a, $b, $c);
$text_color = imagecolorallocate($image, 255, 255, 255);
imagestring($image, 2, 5, 5, 'Server Status: Server is currently up and public.', $text_color);
imagestring($image, 2, 5, 20, 'Streamstatus: Stream is up at '.$sc_stream_bitrate.' kbps with '.$sc_listeners_cur.' of '.$sc_listeners_max.' listeners ('.$sc_uni.' unique)', $text_color);
imagestring($image, 2, 5, 35, 'Listener Peak: '.$sc_listeners_peak.'', $text_color);
imagestring($image, 2, 5, 50, 'Stream Title: '.$sc_server_title.'', $text_color);
imagestring($image, 2, 5, 65, 'Content Type: '.$sc_type.'', $text_color);
imagestring($image, 2, 5, 80, 'Stream Genre: '.$sc_server_genre.'', $text_color);
imagestring($image, 2, 5, 95, 'Stream URL: '.$sc_server_url.'', $text_color);
imagestring($image, 2, 5, 110, 'Stream ICQ: '.$sc_icq.'', $text_color);
imagestring($image, 2, 5, 125, 'Stream AIM: '.$sc_aim.'', $text_color);
imagestring($image, 2, 5, 140, 'Stream IRC: '.$sc_irc.'', $text_color);
imagestring($image, 2, 5, 155, 'Current Song: '.$sc_current_song.'', $text_color);
imagepng($image);
}
wie bzw was müsst ich ändern, umdass die umlaute sichtbar werden und nicht in anderer formation stehen?