Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4594812
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:52:51+00:00 2026-05-21T22:52:51+00:00

i am trying to generate xml files that contain the information that i have

  • 0

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 (" & ", " &amp; ", $_xml);

        return $_xml;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:52:52+00:00Added an answer on May 21, 2026 at 10:52 pm

    Inside the loop you’re reassigning $xml, not concatenating it. Use $xml .= as opposed to $xml =

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to generate an xml file of a recipe database that has
I'm trying to generate POJO's from mapping xml files. I read something about adding
is springdoclet use to generate bean defination xml files? servlet-config.xml..etc ? i trying to
I'm trying to generate a RDoc using the XML format. Here's the command that
I'm trying to generate svg-Code in a web-application. Here's an example output: <?xml version=1.0
I have parametrized persistence.xml. I am trying to generate ddl schema using hbm2ddl. How
I'm new to XML/XSLT and am having an issue trying to change an image
I have a WSDL and some schema files that I used to generate a
I trying to generate an XML document which is around 23 to 30 MB,
I'm trying to generate an XML document from C# List. The xml document must

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.