My php code to read my xml is there anyway to sort by date or event_id?
<?php
$doc = new DOMDocument();
$doc->load( '../events.xml' );
$date = array(); // initialize data array
$books = $doc->getElementsByTagName( "event" );
foreach( $books as $book )
{
$evts = $book->getElementsByTagName( "event_id" );
$evt = $evts->item(0)->nodeValue;
$titles = $book->getElementsByTagName( "title" );
$title = $titles->item(0)->nodeValue;
$images = $book->getElementsByTagName( "image" );
$image = $images->item(0)->nodeValue;
$dates = $book->getElementsByTagName( "date" );
$date = $dates->item(0)->nodeValue;
$descriptions = $book->getElementsByTagName( "description" );
$description = $descriptions->item(0)->nodeValue;
echo "
What - $title <br />
When - $date <br />
$description <br/ >
<img src ='../$image' width='75 height='75'>
<br /><br />
";
}
?>