PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Kai Dorschner   Wiki-Parser   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example implementation
Class: Wiki-Parser
Parse text with Wiki syntax into a XML document
Author: By
Last change:
Date: 14 years ago
Size: 1,159 bytes
 

Contents

Class file image Download
<?php
require_once('WikiParser.php');

$text = "Lorem ipsum dolor sit amet, __consetetur__ sadipscing elitr, sed diam --nonumy-- '''nonumy''' eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

At vero __eos__ et accusam et justo duo dolores et ea rebum.

Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
;

$wiki = new WikiParser();

$x = new DomDocument();
$x->appendChild
(
   
$x->importNode
   
(
       
$wiki->parseAsDomDocument($text)->documentElement,
       
true
   
)
);
echo
$x->saveXML();