Jump to content


This topic is now archived and is closed to further replies.


XML, PHP - getting specific data out

Recommended Posts

Hey all,

I did some searching and really didn't find anything that helped. I know somewhat how to get an xml file to show on the page, but not how to get a specific part of the data out.

Here is what i'm looking for:


On Now


Coming Up

3:30pm - $show_name_30min
4:00pm - $show_name_1hr
4:30pm - $show_name_130min
5:00pm - $show_name_2hr


Here is the format of my XML file. I've got the time and date formated and rounding correctly, no problem there .. but searching through an XML file ... i got nothing  ???

<title>Good Dog</title>
<subepis>Preventing Problems</subepis>
<synopsis>Great show bah bah..</synopsis>


I need to be able to continually pick out the show title based on the current date/time of the day. The sql file holds an entire week of data... anyone have any thoughts ?  I could do this in a second if it was just an SQL database, but with XML I'm totally lost :(

Share this post

Link to post
Share on other sites
Their are two main methods to read xml sax and dom. sax reads through xml and allows you grabs it data. dom loads the xml into an object for you to access, like javascript interacting with HTML.

PHP has expat to read xml which is sax like:


pear has a easier verson of this in:


more detailed example:


Share this post

Link to post
Share on other sites
If you have php5, look at [url=http://"http://us2.php.net/simplexml"]simpleXML[/url]

Share this post

Link to post
Share on other sites


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.