All pastes #270861 Raw Edit

lbj

public text v1 · immutable
·published 2006-12-07 19:38 UTC
rendered paste body
<?php

$dom = new domDocument("1.0","ISO-8859-1");
$dom->formatOutput = 1;
$root = $dom->createElement('forum');

$root->setAttribute('uri', 'http://fudforum.org/index.php');

$branch = $dom->createElement('item');
$branch->setAttribute('id', '1');

$leaf = $dom->createElement('title');
$leaf->appendChild($dom->createTextNode('First Post!!!'));
$branch->appendChild($leaf);

$leaf = $dom->createElement('link');
$leaf->appendChild($dom->createTextNode('http://fudforum.org/index.php/m/1'));
$branch->appendChild($leaf);

$leaf = $dom->createElement('description');
$leaf->appendChild($dom->createTextNode('1st message in the forum.'));
$branch->appendChild($leaf);
$root->appendChild($branch);

$branch = $dom->createElement('item');
$branch->setAttribute('id', '2');

$leaf = $dom->createElement('title');
$leaf->appendChild($dom->createTextNode('Re: First Post!!!'));
$branch->appendChild($leaf);

$leaf = $dom->createElement('link');
$leaf->appendChild($dom->createTextNode('http://fudforum.org/index.php/m/1'));
$branch->appendChild($leaf);

$leaf = $dom->createElement('description');
$leaf->appendChild($dom->createTextNode('Almost like Slashdot.'));
$branch->appendChild($leaf);

$root->appendChild($branch);
$dom->appendChild($root);
echo $dom->saveXML();
?>