Witam
czasami jak w radiu jest grany track z normalnymi znakami (lub nie), wyskakuje błąd typu: xmlParseCharRef: invalid xmlChar value 25
Ktos wie co to moze oznaczac i jak to naprawic?
pod spodem podaje 2 pliki php (1 to parser, a 2 to zwykly wywoływacz):
SHOUTCAST.INC.PHP
<?phpheader("Content-Type: text/xml; charset=UTF-8"); error_reporting(E_ALL);$ch = curl_init("http://4stream.pl:18386/admin.cgi?mode=viewxml&pass=NIEDAM!!");curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $xml = curl_exec($ch); echo utf8_encode($xml); curl_close($ch);?>
PLIK.PHP
<?phperror_reporting(E_ALL);header('Content-type: text/html;charset=iso-8859-2');$feed_url = "http://beta.xfm-radio.tk/shoutcast.inc.php";$feed = simplexml_load_file($feed_url);$limit = 20;$x = 1;foreach($feed->SONGHISTORY->SONG as $item) { if ($x <= $limit) { $song_history = $item->TITLE; $replaced = str_replace(array(" (www.djoles.pl)", " Redmusic.pl", " 4clubbers.pl", " 4clubbers.com.pl"), " ", $item->TITLE); $replaced = str_replace("³", "ł", $replaced); $lol = htmlentities($replaced, ENT_COMPAT , 'UTF-8'); echo($lol.'<br>'); } $x++;}?>
<?phperror_reporting(E_ALL);$feed_url = "http://beta.xfm-radio.tk/shoutcast.inc.php";$feed = simplexml_load_file($feed_url);$limit = 20;$x = 1;foreach($feed->SHOUTCASTSERVER->SONGHISTORY->SONG as $item) { if ($x <= $limit) { $song_history = $item->TITLE; $replaced = str_replace(array(" (www.djoles.pl)", " Redmusic.pl", " 4clubbers.pl", " 4clubbers.com.pl"), " ", $item->TITLE); $replaced = str_replace("³", "ł", $replaced); $replaced = htmlentities($replaced, ENT_COMPAT, 'UTF-8'); echo($replaced.'<br>'); } $x++;}?>