Etarget XML parse

Parser for etarget XML feed

stáhnout snippet
zobrazení: SyntaxHighlighter | GeSHi | Holý text
<?php
$url = 'http://cz.search.etargetnet.com/generic/generic.php?ref=XXXX&xml=1&q='.urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$content = file_get_contents($url);
$xml = new SimpleXMLElement($content);
?>

<div style="text-align: right; color: gray">
	REKLAMA
</div>

<?php foreach($xml->RESULT as $ad) { ?>
<div class="ad">
	<h3><a href="<?php echo $ad->GO ?>"><?php echo $ad->TITLE ?></a></h3>
	<p><?php echo $ad->TEXT ?></p>
	<a href="<?php echo $ad->GO ?>" class="url"><?php echo $ad->URL ?></a>
</div>
<?php } ?>


Tagy:
php 17 řádků | 2008-09-10 13:49:16 | air.kadlec@seznam.cz