PHP Classes

File: generation-example.php

Recommend this page to a friend!
  Classes of Sandeep.C.R   crXml   generation-example.php   Download  
File: generation-example.php
Role: Example script
Content type: text/plain
Description: Example to illustrate XML generation
Class: crXml
Manipulate XML documents as array
Author: By
Last change: added header output
Date: 13 years ago
Size: 410 bytes
 

Contents

Class file image Download
<?php

include 'crXml.php';

$xml = new crXml();

$year = $xml->year;

foreach(
range(1,12) as $m)

{

     
$year->month[$m-1]->noOfDays = date('t',mktime(0,0,0,$m,$m,2000));

     
$year->month[$m-1]->shortName = date('M',mktime(0,0,0,$m,$m,2000));

     
$year->month[$m-1]['name']=date('F',mktime(0,0,0,$m,$m,2000));

 

}
header("Content-Type:text/xml");
echo
$xml->xml();

?>