使用PHP读取XML文件需要帮助

Aam*_*mir 4 php xml parsing

嗨,我想用PHP阅读下面的文件.该文件的大小非常大(以GB为单位).请帮助我,因为我不知道这个.

这是文件

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Articles>
        <Article>
            <header>info about article  </header>

        <metadata>


                    <dc:title>title here</dc:title>
                    <dc:author>author 1</dc:author>
                    <dc:author>author 2</dc:author>
                    <dc:author>author 3</dc:author>
                    <dc:author>author n</dc:author>

                    <dc:subject>subject here</dc:subject>


            </metadata>
        </Article>

        <resume> resume infor </resume>
        </Articles>
Run Code Online (Sandbox Code Playgroud)

pro*_*son 6

如果文件很大,你可能需要使用XMLReader来避免内存不足而不是SimpleXML.