View Single Post
  #12 (permalink)  
Old Jan 5th, 2008, 10:17
alexgeek's Avatar
alexgeek alexgeek is offline
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,790
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: XML > MySQL?

It generates this XML:
HTML: Select all
<?xml version="1.0" encoding="utf-8"?>
<numbers>
  <no>1</no>
  <no>2</no>
  <no>3</no>
  <numbers>
    <no>4</no>
    <no>5</no>
    <no>6</no>
    <no>7</no>
    <no>8</no>
    <no>x</no> 
....
edit!

This code generates the right XML but I still can't get it to loop through.
PHP: Select all

<?php 

define
('XML''numbers.xml');

$xml = new SimpleXMLElement(XMLNULLtrue);

$numbers $xml;

for(
$i 4$i 200$i++) {

$numbers->addChild('no'$i);

}

foreach(
$xml as $n) {echo $n.'<br';} 
$xml->asXML(XML);
 
?>

Last edited by alexgeek; Jan 5th, 2008 at 10:21.
Reply With Quote