Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. $listeTitle = $xml->getElementsByTagName('title');
  3. foreach($listeTitle as $titles) {
  4. if($titles->firstChild->nodeValue == $_GET['title']){
  5. echo "<h2>" . $_GET['title'] . "</h2><br/>" ;
  6.  
  7. $urlFeed=$titles->parentNode->getElementsByTagName('link')->item(0)->nodeValue;
  8.  
  9. $rss = simplexml_load_file($urlFeed);
  10. print_r($rss);
  11. echo '<ul>';
  12. foreach ($rss->channel->item as $item){
  13. $datetime = date_create($item->pubDate);
  14. $date = date_format($datetime, 'd M Y, Hhi');
  15. echo '<li><a href="'.$item->link.'">'.utf8_decode($item->title).'</a> ('.$date.')</li>';
  16. }
  17. echo '</ul>';
  18. }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement