please work
This commit is contained in:
parent
666de311ef
commit
6c11b37aa9
|
@ -26,15 +26,9 @@ $items = iterator_to_array($xml->channel->item);
|
||||||
|
|
||||||
// Sort the items by pubDate
|
// Sort the items by pubDate
|
||||||
usort($items, function($a, $b) {
|
usort($items, function($a, $b) {
|
||||||
$a_time = strtotime($a->pubDate);
|
return strcmp($a->pubDate, $b->pubDate);
|
||||||
$b_time = strtotime($b->pubDate);
|
|
||||||
return $a_time - $b_time;
|
|
||||||
});
|
});
|
||||||
// Debugging
|
|
||||||
foreach ($items as $item) {
|
|
||||||
// Debugging
|
|
||||||
echo $item->pubDate . ' => ' . strtotime($item->pubDate) . '<br>';
|
|
||||||
}
|
|
||||||
// Loop through the sorted items and display them
|
// 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
|
||||||
|
|
Reference in New Issue