PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ahmed Magdy Ezzeldin   XML_Array   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of using the xml class
Class: XML_Array
Store and retrieve arrays in XML documents
Author: By
Last change: more clear example
Date: 17 years ago
Size: 379 bytes
 

Contents

Class file image Download
<?
require_once("xml.php");
$xml = new XML();
$arr = array(
   
"a",
    array(
       
"b1",
       
"b2"
       
),
    array(
       
"c1",
        array(
           
"key" => "c2.1"
           
)
        ),
   
"d"
   
);
   
$str_xml = $xml->array_to_xml($arr, "response", " ");
print
$str_xml;
print
"\n----------------------------------------------------\n";
$arr1 = $xml->xml_to_array($str_xml);
print_r($arr1);
?>