PHP Classes

File: helper/xmlToArray.php

Recommend this page to a friend!
  Classes of Alexey Starikov   PHP Helper Class   helper/xmlToArray.php   Download  
File: helper/xmlToArray.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Helper Class
Call helper functions that are loaded dynamically
Author: By
Last change:
Date: 5 years ago
Size: 586 bytes
 

Contents

Class file image Download
<?php
// xmlToArray
return function ($xml, $options = array(
       
"complexType" => "array",
       
"keyAttribute" => "_attributes",
       
"attributesArray" => "_attributes",
       
// "parseAttributes" => true,
       
"forceEnum" =>array('item'),
       
"ignoreKeys" =>array('item')
    )) {
    require_once
"XML/Unserializer.php";
   
$unserializer = new XML_Unserializer($options);
    if (
$unserializer->unserialize($xml)) {
        return
$unserializer->getUnserializedData();
    }
    else {
        return
null;
    }
}
?>