Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3359202
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:50:37+00:00 2026-05-18T02:50:37+00:00

I am parsing through a XML file that’s about 12mb big. I need to

  • 0

I am parsing through a XML file that’s about 12mb big. I need to parse through the entire file and store what I find necessary in a MySQL database.

I am turning the XML file into an array. Then I parse through the array and store the values.

This works fine when the XML is really small, but it just stops behaving right when I run my 12mb file.

I tried multiple functions that convert XML to array that I found online and none of them work.

This is a common error I got with two different XML to array functions I found online:

Fatal error: [] operator not supported for strings

I am using SimpleXML, is there a better way of resolving this? Are there any libraries other than SimpleXML that are powerful enough to handle large XML files?

I have this now:

$z = new XMLReader;
$z->open('feedfetch.xml');

$doc = new DOMDocument;
while ($z->read() && $z->name !== 'collection');
while ($z->name === 'collection')
{
    $node = simplexml_import_dom($doc->importNode($z->expand(), true));
    var_dump($node[0]);
    exit;

    $z->next('collection');
}

Do you see my var dump? It echoes a bunch of XML objects, but I don’t know how to get to the actual node with the data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:50:38+00:00Added an answer on May 18, 2026 at 2:50 am

    Switch from using SimpleXML to XMLReader when working with large XML files. This is a Pull parser that will not load the entire file into memory to process it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an XML file through Java, and am able to parse through Nodes
I have a script file for parsing through a SQLite database. I now need
I am parsing an XML file through Android Pull Parser technique. First, have a
In android, through xml parsing i have xml file values in tableview now which
I'm trying to parse an xml file that has the contents of a simple
I have an XML file that I want to parse into a database in
i am parsing a big xml file (1 MB) in my WP7 App. The
I'm using SQL Server 2008's XML-parsing abilities to iterate through an XML document and
I am parsing the html file to extract tabular information through column names. And
Scenario: I am parsing values from an XML file using C# and have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.