PHP Classes

File: examples/data.php

Recommend this page to a friend!
  Classes of Bill   PHP Excel Pivot Tables   examples/data.php   Download  
File: examples/data.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Excel Pivot Tables
Extends PHP Excel classes with pivot table support
Author: By
Last change:
Date: 1 year ago
Size: 536 bytes
 

Contents

Class file image Download
<?php
function load_data() {
 
$xmlDoc = new \DOMDocument();
 
$xmlDoc->load( __DIR__ . "/data.xml");
 
$data = array();
  foreach (
$xmlDoc->documentElement->childNodes AS $item)
  {
    if (
$item->nodeType == XML_ELEMENT_NODE ) {
   
$data []= array( "Account" => $item->getAttribute("account"),
     
"Genre" => $item->getAttribute("genre"),
     
"Images" => $item->getAttribute("images"),
     
"Average Ranking" => $item->getAttribute("avgrank"),
     
"Total Size" => $item->getAttribute("size") );
    }
  }
  return
$data;
}
?>