Menu
I have an xml file that I am extracting the text of articles from.
The structure is as follows:
<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<articles>
<article>
<title></title>
<date></date>
<author></author>
<id></id>
<url></url>
<type><type>
<position></position>
<summary></summary>
<text></text>
</article>
</articles>
I want to output them sorted by date. Any advice?
<?php
$xml = simplexml_load_file(“data/data.xml”);
foreach($xml as $user)
{
echo $user->text;
}
?>