Jump to content

Get date from an XML file


annihilate

Recommended Posts

Hello, I am trying to retrieve some data from an XML file and I am using some code from [a href=\"http://www.zend.com/zend/spotlight/code-gallery-wade6.php\" target=\"_blank\"]here[/a] to do it. The problem I am having is how to get the 'date uts' value, in the example below it is 1141249715.

The other values I can get ok using $_item['URL'] for example, and $_item['DATE'] gets me the Mar 1, 2006 bit.

[code]<track>
  <artist mbid="665e63e9-cf0c-49c7-b98d-0d42ff9c50de">The Jimi Hendrix Experience</artist>
  <name>In From The Storm</name>
  <mbid />
  <url>http://www.last.fm/music/The+Jimi+Hendrix+Experience/_/In+From+The+Storm</url>
  <date uts="1141249715">Mar 1, 2006, 21:48</date>
  </track>[/code]
The alternative I suppose would be to convert the Mar 1, 2006 bit into a timestamp, but seems overkill when there is already a timestamp there, I just can't work out how to access it!

Thanks
Link to comment
Share on other sites

Dude, I knew you could pick up chicks in an XML file!

Seriously though, after reading through that website it seems that the code posted there does not support extracting those tags. I haven't had to parse XML with PHP yet but I may investigate and see if I can be of more help later.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.