Ciao a tutti, avrei bisogno che il risultato di questo codice mi metta in ordine dei feed rss come posso fare?

Ecco il codice:

Codice PHP:
<?php
$RSS_Content 
= array();

function 
RSS_Tags($item$type)
{
        
$y = array();
        
$tnl $item->getElementsByTagName("title");
        
$tnl $tnl->item(0);
        
$title $tnl->firstChild->textContent;

        
$tnl $item->getElementsByTagName("link");
        
$tnl $tnl->item(0);
        
$link $tnl->firstChild->textContent;
        
        
$tnl $item->getElementsByTagName("pubDate");
        
$tnl $tnl->item(0);
        
$date $tnl->firstChild->textContent;        

        
$tnl $item->getElementsByTagName("description");
        
$tnl $tnl->item(0);
        
$description $tnl->firstChild->textContent;

        
$y["title"] = $title;
        
$y["link"] = $link;
        
$y["date"] = $date;        
        
$y["description"] = $description;
        
$y["type"] = $type;
        
        return 
$y;
}


function 
RSS_Channel($channel)
{
    global 
$RSS_Content;

    
$items $channel->getElementsByTagName("item");
    
    
// Processing channel
    
    
$y RSS_Tags($channel0);        // get description of channel, type 0
    
array_push($RSS_Content$y);
    
    
// Processing articles
    
    
foreach($items as $item)
    {
        
$y RSS_Tags($item1);    // get description of article, type 1
        
array_push($RSS_Content$y);
    }
}

function 
RSS_Retrieve($url)
{
    global 
$RSS_Content;

    
$doc  = new DOMDocument();
    
$doc->load($url);

    
$channels $doc->getElementsByTagName("channel");
    
    
$RSS_Content = array();
    
    foreach(
$channels as $channel)
    {
         
RSS_Channel($channel);
    }
    
}


function 
RSS_RetrieveLinks($url)
{
    global 
$RSS_Content;

    
$doc  = new DOMDocument();
    
$doc->load($url);

    
$channels $doc->getElementsByTagName("channel");
    
    
$RSS_Content = array();
    
    foreach(
$channels as $channel)
    {
        
$items $channel->getElementsByTagName("item");
        foreach(
$items as $item)
        {
            
$y RSS_Tags($item1);    // get description of article, type 1
            
array_push($RSS_Content$y);
        }
         
    }

}


function 
RSS_Links($url$size 15)
{
    global 
$RSS_Content;

    
$page "<ul>";

    
RSS_RetrieveLinks($url);
    if(
$size 0)
        
$recents array_slice($RSS_Content0$size 1);

    foreach(
$recents as $article)
    {
        
$type $article["type"];
        if(
$type == 0) continue;
        
$title $article["title"];
        
$link $article["link"];
        
$page .= "[*]<a href=\"$link\">$title</a>\n";            
    }

    
$page .="[/list]\n";

    return 
$page;
    
}



function 
RSS_Display($url$size 15$site 0$withdate 0)
{
    global 
$RSS_Content;

    
$opened false;
    
$page "";
    
$site = (intval($site) == 0) ? 0;

    
RSS_Retrieve($url);
    if(
$size 0)
        
$recents array_slice($RSS_Content$site$size $site);

    foreach(
$recents as $article)
    {
        
$type $article["type"];
        if(
$type == 0)
        {
            if(
$opened == true)
            {
                
$page .="[/list]\n";
                
$opened false;
            }
            
$page .="[b]";
        }
        else
        {
            if(
$opened == false
            {
                
$page .= "<ul>\n";
                
$opened true;
            }
        }
        if(
$withdate)
        {
        
$nowdata=date ("D, d M Y");
        
$nowore=date ("H:i:s");
        
$agendanow="$nowdata $nowore GMT";
          
$datelong $article["date"];
        
$date=substr($datelong517);
          
$page .=' <span class="rssdate">'.$date.'</span>';
        }
        
$title $article["title"];
        
$link $article["link"];
        
$page .= "[*]<a href=\"$link\">$title</a>";
        
$description $article["description"];
        if(
$description != false)
        {
            
$page .= "
<span class='rssdesc'>
$description$agendanow</span>";
        }
        
$page .= "\n";            
        
        if(
$type==0)
        {
            
$page .="[/b]
"
;
        }

    }

    if(
$opened == true)
    {    
        
$page .="[/list]\n";
    }
    return 
$page."\n";
    
}


?>

Grazie a tutti