-2

I need to write PHP to export/import user data from one install of WordPress to another. I'd like to use XML. However, I'm not sure which libraries/functions would be best to use. Any advice? Thanks

Cyrcle
  • 1,363
  • 3
  • 13
  • 25
  • 3
    http://php.net/manual/en/book.simplexml.php – Abdelilah Feb 18 '13 at 17:12
  • Please search a bit and read some manuals before asking a question. Especially as your question is very generic and obviously you're not the first person on earth with that problem ;) - Use SO for the more harder questions, like concrete problems. – hakre Feb 18 '13 at 17:32

2 Answers2

0

SimpleXMLElement to start with.

sybear
  • 7,837
  • 1
  • 22
  • 38
  • Skimming through SimpleXML I'm not seeing much for creating the XML file, just reading it? – Cyrcle Feb 18 '13 at 17:18
  • You don't have to create XML files. You can read, modify and access the needed data via SimpleXMLElement. – sybear Feb 18 '13 at 17:22
  • http://php.net/manual/en/book.xmlwriter.php if you want to write xml – Abdelilah Feb 18 '13 at 17:29
  • 1
    @Cyrcle: Have you skimmed [*Example #10 Adding elements and attributes*](http://php.net/simplexml.examples-basic.php) ? – hakre Feb 18 '13 at 17:30
  • I just saw example #10. Time to do some playing and see if this will work for me. – Cyrcle Feb 18 '13 at 17:31
  • try looking at DOMDocument if SimpleXMLElement isnt going to meet your needs. you should be able to just write your XML to a file with fwrite – JP_ Feb 18 '13 at 17:39
0

SimpleXML is geared toward reading XML. I'm going with DOM.

Cyrcle
  • 1,363
  • 3
  • 13
  • 25