Results 1 to 2 of 2

Thread: Sort XML elements by Date Element?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Sort XML elements by Date Element?

    Hello I am using a DOMDocument to retrieve information from an XML file. The information is setup like so:

    Code:
    <person>
    <name>John Smith</name>
    <born>March 15th, 1987</born>
    </person>
    <person>
    <name>Eric Lee</name>
    <born>July 18th, 1949</born>
    </person>
    <person>
    <name>Michael Arnold</name>
    <born>April 2nd, 2003</born>
    </person>
    At the moment I am displaying just the names of each of these groups on the page. How would I display the names of each of these people according to when they were born? (Youngest to oldest or oldest to youngest)

    I believe it has something to do with strtotime() and sort() but can someone explain or give an example?

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: Sort XML elements by Date Element?

    Does anyone have an idea/suggestion?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width