serderunselty
New Member
Below is my XML file\[code\]<?xml version="1.0"?><calender><task><date>00/00/0000</date><title>My Birthday</title><description>Today is my birthday!</description></task><task><date>04/08/2013</date><title>test</title><description>swdefswde</description></task><task><date>04/02/2013</date><title>test</title><description>test</description></task><task><date>04/01/2013</date><title>egfwe</title><description>wefwef</description></task><task><date>04/03/2013</date><title>ssdv</title><description>ssdvs</description></task></calender>\[/code\]I'm trying to add them into an array, and resort the elements by date [then rewrite the xml file with the sorted xml]. Can someone please help me?I have tired the following code but doesnt work [cant even add them to array]\[code\]$xml_temp = array();foreach ($xml_add->task as $aTask) { $xml_temp[] = $aTask; } print_r ($xml_temp);\[/code\]