PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Dom Hastings   PHP Chunk   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example implementation
Class: PHP Chunk
Extract chunks from large XML files
Author: By
Last change:
Date: 15 years ago
Size: 321 bytes
 

Contents

Class file image Download
<?php
require_once('class.chunk.php');

$file = new Chunk('complex-test.xml', array('element' => 'Object'));

$i = 0;

$start = microtime(true);

while (
$xml = $file->read()) {
 
$i++;
}

print
"<p>Wow! I found {$i} &lt;Object/&gt;s in there!</p>";

$end = microtime(true) - $start;

print
"<p>Completed in {$end}s</p>";