Hi. I'm a bit rusty on php and xml, so forgive if this is a naive question.
I have built a dynamic gallery using config.php by copying the script provided elsewhere. The creation of the XML bit is below:

for ($i=0; $i<sizeof($gallery); $i++)
{
    echo '<image imageURL="images/'.$gallery[$i].'" thumbURL="images/'.$gallery[$i].'" linkURL="" linkTarget="">';
    echo '<title></title>';
    echo '<caption></caption>';
    echo '</image>';
}

To display the filename as title, I changed the second "echo" line to:

    echo '<title><![CDATA['.$gallery[$i].']]></title>';

This works fine, but now I want to change the title to use substrings of the filename. It contains the date and time of the image, like  "cap_file20150514095246.jpg", which I want to display as  "2015-05-14   09:52". I can handle this in normal php, but everything I try within the "echo" line refuses to work - i.e. no images are shown at all.

Cay you help with any hints how to do this?

Thanks