Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Leszek Piatek  >  Slow XML Parser  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample PHP script using xml_parser Class
Class: Slow XML Parser
Parse XML documents using pure PHP code
Author: By
Last change:
Date: 2008-06-25 16:40
Size: 416 bytes
 

Contents

Class file image Download
<?php

//include class
include('xml_parser.php');

//create new instance of xml_parser
$xml=new xml_parser();

//load data from file with
$xml->load('sample.xml');

// or use $xml->loadData() to load plaintext data
// $xml->loadData('<xml><data>asdfasdf</data></xml>');

//return nice parsed array
print_r($xml->parse());

//and some other feature -> get the xml encoding
$xml->getEncoding();

?>