CSV/XML

Out of context: Reply #2

  • Started
  • Last post
  • 12 Responses
  • enobrev0

    i would say go for xml, if at least to learn how. csv is easier but may not be robust enough for your needs. No way for me to tell.

    When working with xml on php there's 2 major camps. DOM and SAX. In my experience, most servers have SAX installed and not DOM, although other's results may vary.

    the DOM functions essentially break up your php document into a managable php object which you can use to access the data.

    The SAX method gives you the proper tools needed to loop through the xml and create your object / array / etc according to your needs. This method seems to take a bit more work, but can be just as powerful. It's the method I've used most - due to server setups.

    Here's a class that uses the sax method and creates an array for you to access the data
    http://www.devdump.com/phpxml.ph…

    And here's some more info about sax based parsers from IBM
    http://www-106.ibm.com/developer…

    And a pretty decent article comparing dom and sax (expat)
    http://www.netmag.co.uk/tutorial…

    good luck!

View thread