I have a xml file like this
<?xml version="1.0" encoding="UTF-8"?>
<gallery >
<gallerydata>
<galleryname>
Home
</galleryname>
<createdat>
14/8/2010 4:53 pm
</createdat>
</gallerydata>
<gallerydata>
<galleryname>
School
</galleryname>
<createdat>
13/8/2010 5:19 pm
</createdat>
</gallerydata>
<gallerydata>
<galleryname>
Company
</galleryname>
<createdat>
15/8/2010 5:21 pm
</createdat>
</gallerydata>
</gallery>
Iam using xpath and xquery for parsing this xml file
$xml_str = file_get_contents($file);
$xml = simplexml_load_string($xml_str);
$nodes = $xml->xpath('//gallery/gallerydata');
How i can get the latest gallery data, i mean latest file (the data with last date )
Is their any way to do ?Please help me