Hey everyone,
I am building an XML document successfully with the following code:
public function build($result) {
$root = $this->append(new xmlElement('data'));
$root->append(new xmlElement('collection'));
while($row = pg_fetch_assoc($result)){
foreach($row as $fieldname => $fieldvalue){
$second = $root->append(new xmlElement($fieldname));
$second->write($fieldvalue);
// $seconds_child = $second->append(new xmlElement('second child child'));
// $seconds_child->write("second's child content");
}
}
}
My question is, what is the best way to do this recursively?
Thanks!