使用php从一组xml文件中提取内容

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.

  • 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