PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Michael A. Peters  >  docType  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Sample script
Class: docType
Create HTML or XHTML depending on the user browser
Author: By
Last change:
Date: 12 years ago
Size: 710 bytes


Class file image Download
$dom = new DOMDocument('1.0','UTF-8');
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;

$myPage = new docType($dom);
$xmlHtml = $myPage->document();

$xmlHead = $dom->createElement('head');
$xmlTitle = $dom->createElement('title','I Am a Web Page');

$xmlfile = 'content.xml';
$buffer = file_get_contents($xmlfile);
$tmpDOM = new DOMDocument('1.0','utf-8');
$nodeList = $tmpDOM->getElementsByTagName('body');
$impBody = $nodeList->item(0);
$xmlBody = $dom->importNode($impBody,true);


For more information send a message to info at phpclasses dot org.