From 6c11b37aa9f263677a83e535f441416dfbef64e3 Mon Sep 17 00:00:00 2001 From: Mohamad Damaj Date: Wed, 28 Jun 2023 22:11:08 +0300 Subject: [PATCH] please work --- site/blog/index.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/site/blog/index.php b/site/blog/index.php index b5b7cbd..3ed6f9e 100644 --- a/site/blog/index.php +++ b/site/blog/index.php @@ -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) . '
'; -} + // Loop through the sorted items and display them foreach ($items as $item) { // Add a box around the article