Remove mess in RSS parser
This commit is contained in:
		
							parent
							
								
									9aca27dc05
								
							
						
					
					
						commit
						8fcce83abd
					
				
					 1 changed files with 1 additions and 6 deletions
				
			
		| 
						 | 
					@ -24,12 +24,7 @@ $xml = simplexml_load_file($feed);
 | 
				
			||||||
// Get all items as an array
 | 
					// Get all items as an array
 | 
				
			||||||
$items = iterator_to_array($xml->channel->item);
 | 
					$items = iterator_to_array($xml->channel->item);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Sort the items by pubDate
 | 
					// Loop through the items and display them
 | 
				
			||||||
usort($items, function($a, $b) {
 | 
					 | 
				
			||||||
return strcmp($a->pubDate, $b->pubDate);
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Loop through the sorted items and display them
 | 
					 | 
				
			||||||
foreach ($items as $item) {
 | 
					foreach ($items as $item) {
 | 
				
			||||||
    // Add a box around the article
 | 
					    // Add a box around the article
 | 
				
			||||||
    echo '<div class="article-box">';
 | 
					    echo '<div class="article-box">';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue