Hi... can any one help me plz... i use simplexml_load_string then get error Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Unsupported encoding windows-874 in Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0" encoding="windows-874"?> in Code (markup): my code below <? $xml = "http://www.ido24.com/xml_code_hotel_full_request.php?p=108trip.com&d=rayong&c=USD&l=en&s=r"; $session = curl_init($xml); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($session); curl_close($session); $parsed_xml = simplexml_load_string($response); foreach ($parsed_xml->item as $item1) { echo $item1->hname.'<hr/>'; } ?> Code (markup): then i try to convert to utf-8 by code $rawdata = file_get_contents("http://www.ido24.com/xml_code_hotel_full_request.php?p=108trip.com&d=rayong&c=USD&l=en&s=r"); $readydata = iconv('windows-874' , 'utf-8' , $rawdata); $session = curl_init($readydata); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($session); curl_close($session); $parsed_xml = simplexml_load_string($response); foreach ($parsed_xml->item as $item1) { echo $item1->hname.'<hr/>'; } Code (markup): it's nothing display can anyone help me please ... i run on hosting linux godaddy.com but i run other hosting (in thailand) it's worked. Thank... jam
Well this is not the way it should be done, but try to $xml = "http://www.ido24.com/xml_code_hotel_full_request.php?p=108trip.com&d=rayong&c=USD&l=en&s=r"; $session = curl_init($xml); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($session); curl_close($session); $response = str_replace('windows-874','utf-8',$response); $parsed_xml = simplexml_load_string($response); PHP:
Hi, I have a sitemap generator script for windows hosting. If youwant PM me your mail i'll conatct you personally.