i am trying to generate xml files that contain the information that i have inserted in the console of the application. it contain title information and a image gallery, i am having problem with listing the image gallery pictures. everything else is generated correctly but when i try to populate the information of the image gallery it dont work. this is a copy of the problem, please advice and i am still a beginner and this might be a stupid mistake but please a need help.
function array2XML($anews)
{
$images = $this->selectAllImages($anews);
$_xml = " <tag path=\"".wk_show($anews['FileLink'])."\">\n"
." <title>".wk_show($anews['Title'])."</title>\n"
." <dateT>".wk_show($anews['Date'])."</dateT>\n"
." <desc>".wk_show($anews['Content'])."</desc>\n"
." <photos pathTh=\"admin/images/news/thumbs/\" pathPr=\"admin/images/news/preview/\">\n";
// here is the problem when i remove it it works but it only take 1 image of the gallery
foreach($images as $image)
{
echo "i am in the loop <br />";
$_xml =" <tag path=\"".wk_show($image['FileLink'])."\"/>\n";
}
$_xml =" </photos>\n"
." </tag>\n";
$_xml = preg_replace(array("/\&([a-z\d\#]+)\;/i", "/\&/", "/\#\|\|([a-z\d\#]+)\|\|\#/i", "/(\=\"\-\/\%\?\!\'\(\)\[\\{\}\ \#\+\,\@_])/e"),
array("#||\\1||#", "&", "&\\1;", "'&#'.ord('\\1').';'"),
$_xml);
$_xml = ereg_replace (" & ", " & ", $_xml);
return $_xml;
}