Hi,
I’m using Simple XML to read from an XML file. I’ve done a loop for each event. It gives me all the events back in the order of the XML file. However, instead I am trying to sort events by date. Any idea how I could do this?
Please see my code below. Thanks in advance for your help.
[PHP]$newresult = $result->xpath("//match/matchname[.=’$uniqueteam’]/…");
foreach ($newresult as $newmatchlist) {
$newmatch = trim($newmatchlist->{'matchname'}[0]);
$sport = $newmatchlist->{'sportname'}[0];
$tournament = $newmatchlist->{'tournamentname'}[0];
$time=$newmatchlist->{'matchname'}[0]['dateandtime'];
}[/PHP]