PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Taha Paksu   SimpleXML for PHP4   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: How to use it
Class: SimpleXML for PHP4
Load XML files in PHP 4 like SimpleXML extension
Author: By
Last change: added some ideas
Date: 16 years ago
Size: 426 bytes
 

Contents

Class file image Download
<?
require_once "simplexml.class.php";

//if you want to use it as a function;

if(!function_exists("simplexml_load_file")){
 function
simplexml_load_file($file){
 
$sx = new simplexml;
  return
$sx->xml_load_file($file);
 }
}

//or directly:

echo "<pre>";
$file = "http://musicbrainz.org/ws/1/track/?query=metallica&type=xml";
$sxml = new simplexml;
$data = $sxml->xml_load_file($file);
print_r($data);
?>