Hi...
can any one help me plz...
i use simplexml_load_string then get error
Code:
Code:
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
my code below
Code:
<?
$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/>';
}
?>
then i try to convert to utf-8 by code
Code:
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/>';
}
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
|