Welcome Guest, Not a member yet? Register   Sign In
Reformat XML 'date' output.
#1

[eluser]Poccuo[/eluser]
If I have a DB row full of dates in this format:

2008-07-03
2008-06-01
2008-04-16

And I'd like to export them in XML in the following format:

07.03.08
06.01.08
04.16.08

I'm able to successfully export them in the former format via the following code:

Code:
$query = $this->db->query("SELECT date FROM news");
        
$config = array (
    'root'    => 'news',
    'element' => 'item',
    'newline' => "\n",
    'tab'    => "\t"
);

$data = $this->dbutil->xml_from_result($query, $config);
        
write_file("./data/news.xml", $data);

But I'm not sure what steps would be necessary to convert the query values to the format I desire.

Please help!


Messages In This Thread
Reformat XML 'date' output. - by El Forum - 11-13-2008, 11:03 PM
Reformat XML 'date' output. - by El Forum - 11-14-2008, 09:09 AM
Reformat XML 'date' output. - by El Forum - 11-14-2008, 10:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB