Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Johnny Brochard  >  Array 2 XML  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: two examples
Class: Array 2 XML
Store associative array data on file in XML
Author: By
Last change:
Date: 2004-08-27 08:10
Size: 519 bytes
 

Contents

Class file image Download
<?php

    
include_once("class.array2xml2array.php");
    
    
$admins = array("admin1""admin2""admin3");
    
$config = array("config" => array(
                            
"filepath" => "/tmp",
                            
"interval" => 5
                            
"admins"=>$admins));

    
$array2XML = new CArray2xml2array();
    
    
// no root
    
$array2XML->setArray($admins);
    if (
$array2XML->saveArray("admins.xml""admins")){
        echo 
"admins array save<br>";
    }
    
    
// one root
    
$array2XML->setArray($config);
    if(
$array2XML->saveArray("config.xml")){
        echo 
"config array save<br>";
    }

?>