Advertisement
achshar

Untitled

May 12th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.     $feed_url="http://www.ezrss.it/feed/";
  4.     $feed = simplexml_load_file($feed_url);
  5.  
  6.     include_once('includes/connection.php');
  7.     include_once('includes/article.php');
  8.  
  9.     $article = new Article;
  10.     $articles = $article->fetch_all();
  11.  
  12.     $query = $pdo->prepare("SELECT article_title FROM articles ORDER BY article_id DESC LIMIT 1");
  13.                
  14.     $query->execute();
  15.     $title = $query->fetchColumn();
  16.     $array = array();
  17.  
  18.     foreach($feed->channel as $item) {
  19.         foreach($item->item as $info) {$array[] = array((string) $info->title, (string) $info->link);}
  20.     }
  21.    
  22.     $add = false;
  23.     foreach(array_reverse($array) as $key => $value) {
  24.         if($add) {
  25.             //add sql code
  26.         }
  27.         if($value[0] == $title) $add = true;
  28.     }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement