The $dom1
variable needs to be set outside of the foreach loop.
i.e.
$dom1 = new DOMDocument("1.0", 'utf-8');
$dom1->formatOutput = true;
foreach($photo as $value) {
$dom1->appendChild(...);
...
}
$xml = $dom1->save();
It's only one record because you're overwriting the $dom1
each time where you have the comment // create doctype
null
2009-08-11 20:05:47