Ra.
Ra.

Reputation: 955

Extract the content from set of xml files using php

I have set of xml files in the same structure. What I want to do is extract the content from set of files or from the specified folder. The structure look like in all the xml files,

...
<FAQs>
<content> test</content>
<creator>myname</creator>
</FAQs>
...

How this can be achieved using php?

Thanks in advance.

Upvotes: 0

Views: 67

Answers (1)

konsolenfreddy
konsolenfreddy

Reputation: 9671

  • Get all the files, e.g. with glob
  • iterate over the files with a loop
  • load the files with simplexml_load_file
  • Now you've got objects of the XMLs

Upvotes: 2

Related Questions