please work

This commit is contained in:
Mohamad Damaj 2023-06-28 22:11:08 +03:00
parent 666de311ef
commit 6c11b37aa9
1 changed files with 2 additions and 8 deletions

View File

@ -26,15 +26,9 @@ $items = iterator_to_array($xml->channel->item);
// Sort the items by pubDate
usort($items, function($a, $b) {
$a_time = strtotime($a->pubDate);
$b_time = strtotime($b->pubDate);
return $a_time - $b_time;
return strcmp($a->pubDate, $b->pubDate);
});
// Debugging
foreach ($items as $item) {
// Debugging
echo $item->pubDate . ' => ' . strtotime($item->pubDate) . '<br>';
}
// Loop through the sorted items and display them
foreach ($items as $item) {
// Add a box around the article