PHP code example of algm / largexmlreader
1. Go to this page and download the library: Download algm/largexmlreader library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
algm / largexmlreader example snippets
use Algm\LargeXmlReader\Xml\Reader;
$xmlStream = fopen($xmlFilePath, 'r');
// open the stream to read all nodes recursively (defaults to two levels)
$reader = Reader::openStream($xmlStream);
// or set the reader to find all repeating <item /> tags
$reader = Reader::openUniqueNodeStream($xmlStream, 'item');
$iterator = $reader->process();
foreach ($iterator as $nodeData) {
// do something with the node
}