重複の可能性:
urlphpからのxmlの解析
ホスティングが一部のdomまたはsimplexml関数で機能しないため、URLからxml-documentを解析し、CURLを使用するように解決する必要があります。ユーロの記号を置き換えて表示するにはどうすればよいですか。関数str_replaceは私を助けません。
<?php
$url = 'http://www.aviasales.ru/latest-offers.xml';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'app');
$query = curl_exec($ch);
curl_close($ch);
$xml=simplexml_load_string($query);
//$xml = str_replace('€', '€', $xml);
?>
<table width=100%>
<tr bgcolor="#CAE8F0" align="left">
<td><b><?= $xml->offer[1]['title']?></b></td>
<td width=5%><b><a href="<?=$xml->offer[1]["href"]?>">buy</a></td>
</tr>
</table>